Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Score After Applying Operations on a Tree
Coding
- Minimum Number of Operations to Sort a Binary Tree by Level
Coding
- Minimum Operations to Stabilize a Binary Tree
Coding
- Add One Row to Tree
Coding · Binary Tree · Breadth-First Search · Depth-First Search
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1993. Operations on Tree
Interview date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source