Store a hierarchy and return all children

Read the full interview experience this question came from →

Quick Overview

This question evaluates understanding of hierarchical data modeling, REST API design, database schema choices (e.g., adjacency list vs alternatives), and systems-level concerns like scalability, pagination for large subtrees, and cycle prevention.

Store a hierarchy and return all children

Company: Atlassian

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

Design a service to store a hierarchical tree of nodes and expose APIs. Requirements: - Persist a hierarchy (a forest with multiple roots is acceptable). - Support: 1) Add a node under a parent. 2) Return **all descendants** (all children recursively) of a given node. - Emphasis on REST API design, DB schema, and edge cases. Deliverables: - API endpoints and example requests/responses. - Storage model choice (e.g., adjacency list, materialized path, nested sets, closure table) and justification. - How to handle large subtrees (pagination) and prevent cycles.

Overview: This question evaluates understanding of hierarchical data modeling, REST API design, database schema choices (e.g., adjacency list vs alternatives), and systems-level concerns like scalability, pagination for large subtrees, and cycle prevention.

Read the full Atlassian Software Engineer interview experience this question came from

|Home/System Design/Atlassian
Atlassian logo
Atlassian
Jan 5, 2026
mediumSoftware EngineerOnsiteSystem Design
5
0

Design a service to store a hierarchical tree of nodes and expose APIs.

Requirements:

  • Persist a hierarchy (a forest with multiple roots is acceptable).
  • Support:
    1. Add a node under a parent.
    2. Return all descendants (all children recursively) of a given node.
  • Emphasis on REST API design, DB schema, and edge cases.

Deliverables:

  • API endpoints and example requests/responses.
  • Storage model choice (e.g., adjacency list, materialized path, nested sets, closure table) and justification.
  • How to handle large subtrees (pagination) and prevent cycles.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...