Remove and Compact a Parent-Index Forest

Quick Overview

Remove a node and all descendants from a parent-index forest, preserve surviving order, compact indices, and rewrite every surviving parent reference without mutating the input.

Remove and Compact a Parent-Index Forest

Company: Pinterest

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Remove a node and all descendants from a parent-index forest, preserve surviving order, compact indices, and rewrite every surviving parent reference without mutating the input.

Pinterest logo
Pinterest
Aug 27, 2026
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
Loading...