Design a Hierarchical Tree Storage System
Design a system to store and retrieve a general-purpose hierarchical tree structure with the following characteristics: nodes can represent any data (e.g., file system entries, org chart employees, wiki pages); there can be multiple root nodes (nodes with no parent); each node can have multiple children. The system must support: (1) adding a child node to any existing node, and (2) retrieving all children of a given node, with a 'terminal' indicator per child showing whether it has further children. Focus on API design and data modeling. Follow-up: support viewing the full expanded path/tree from the root down to a given node.
Asked at:
Atlassian