Ensure thread-safe updates to org hierarchy
Company: Atlassian
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
For the aforementioned organization hierarchy, design thread-safe add/remove operations for users and groups. Propose an API and concurrency strategy (e.g., reader–writer locks, fine-grained locking, lock ordering to avoid deadlocks, or immutable snapshots with copy-on-write). Explain how to guarantee linearizable or at least read-consistent queries while updates occur, and how to handle long-running reads. Discuss contention hot spots, performance trade-offs, failure recovery, and how to test concurrency correctness (stress tests, race detection).
Quick Answer: Ensure thread-safe updates to org hierarchy evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.