InterviewDB Question

Tree Backend: Design a REST API for Managing a Hierarchical Tree Structure

Backend phone

Question Details

Problem Design a backend API for managing hierarchical data (e.g., org charts, category trees). Each node has an id, name, parent_id, and optional metadata. Implement these endpoints: Example Follow-ups What database representation (adjacency list, nested sets, closure table, path enumeration) fits best for this use case? How do you implement GET /subtree efficiently without loading the whole table? How do you prevent a move operation from creating a cycle?

Full Details

🔒

Unlock all Jane Street questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a jane street interview for a backend role during the phone round.

It covers the following topics: Coding, Sql, Phone, Onsite .