โ† Juspay questions
Low-Level DesignReported in a candidate post, Feb 2026

Design a locking system on an M-ary tree

Filed under Juspay

The question

Design and implement a locking system on a generic M-ary tree supporting Lock, Unlock, and UpgradeLock operations. A node can only be locked if neither it, its ancestors, nor its descendants are locked; UpgradeLock locks a node and unlocks all its locked descendants if all descendants share the same user ID and no ancestor is locked.

No write-up yet. Related questions below have one.

Related Juspay questions

Collected from public candidate posts and coding forums. Updated Nov 2026.