Find users with access to all cameras
VerkadaSoftware Engineer · Technical ScreenLast updated
This question evaluates understanding of graph modeling and traversal techniques, particularly transitive closure, cycle detection, and BFS-based permission propagation across nested group relationships.
Given entities and relationships (user, owns, camera), (user, belongs_to, group), (group, owns, camera), and (group, belongs_to, group) where groups can be nested arbitrarily, a user has access to a camera if they directly own it or belong transitively to any group that owns it. Design an algorithm to find all admin users who have access to every camera. Specify the input representation, handle cycles in group membership, describe a BFS-based approach, and analyze time and space complexity. Provide the algorithm steps and discuss edge cases.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.