Convert a flat list into a tree
Build parent-child relationships efficiently from id/parentId pairs; handle root nodes and missing parents.
Implementation Requirements & Edge Cases
- Build parent-child relationships efficiently from id/parentId pairs.
- handle root nodes and missing parents.
Interview Evaluation Criteria
- Clarify constraints, API shape, error handling, and asynchronous edge cases upfront.
- Verify keyboard accessibility, clean state modeling, and zero memory/timer leaks where applicable.
- Discuss time/space tradeoffs and write test cases covering empty, invalid, and boundary inputs.
Module Context & References
JavaScript · Data & DOM Transformations, nested structures and DOM events
Personal Notes · Markdown