FFigma·DSAProduct EngTechnical Phone Screen
Update a Layer Tree Preserving Z-Order
Problem
Figma coding looks like pieces of the editor. Given a layer tree, implement operations: reorder a layer (preserve z-order), reparent a layer, or compute the front-to-back render order.
Example
layers tree -> move layer up one; recompute z-order
Constraints
- Preserve sibling order; handle reparent into descendant
What Figma looks for
Reported Figma style. Call out time/space trade-offs and edge cases before being asked.
added 6 days ago