Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1993. Operations on Tree
Design a data structure for a rooted tree that supports lock(num,user), unlock(num,user) and upgrade(num,user) operations where lock/unlock enforce ownership, and upgrade locks a node only if it is unlocked, has at least one locked descendant (by any user), and has no locked ancestors — then it unlocks all descendants. The core challenge is efficiently checking and updating ancestor/descendant lock status (and mass-unlocking descendants) across many operations.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.