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.