Design N-ary tree with lock and unlock operations
Filed under Amazon
The question
Design an N-ary tree supporting lock and unlock operations with minimum complexity, where a node can only be locked if its ancestors/successors are not locked.
No write-up yet. Related questions below have one.
Related Amazon questions
Collected from public candidate posts and coding forums. Updated Nov 2026.