Resolve Effective Access Through Nested Groups And Deny Policies
Last updated: November 29, 2026
Quick Overview
Given users, nested group memberships (which may contain cycles) and allow/deny policies with glob patterns on actions and resources, decide whether a user can perform an action on a resource, with explicit deny winning, and explain the decision by the membership chain that granted or blocked it.
Vanta
November 29, 20260
0
0 solved
Given users, nested group memberships (which may contain cycles) and allow/deny policies with glob patterns on actions and resources, decide whether a user can perform an action on a resource, with explicit deny winning, and explain the decision by the membership chain that granted or blocked it.
Access reviews are a core Vanta workflow: an auditor wants proof that only the right people can reach production, and that answer depends on nested groups in Okta or Google Workspace combined with cloud IAM policies. The problem checks graph traversal with cycles, policy evaluation order, and producing an explanation a reviewer can trust.
What the Interviewer Expects
- Traverses nested groups with a visited set so cycles terminate
- Evaluates explicit deny, then allow, then implicit deny
- Matches actions and resources with glob patterns correctly
- Returns the policies and the shortest membership chain as justification
- Discusses complexity and caching for a full access-review report
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you generate the full access matrix for 5,000 users and 50,000 resources efficiently?
- Add conditions such as 'only from the corporate IP range' or 'only with MFA'. How does the model change?
- How would you detect users whose access comes only through a stale group nobody owns?
- How do you show a reviewer what changed in effective access since last quarter?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
member_of maps a principal to groups it directly belongs to; groups can nest and cycles happen in real directories (eng -> oncall -> eng). Policies name a principal, an effect, and glob lists for ...
High-Level Design
- BFS from the user over
member_of, recording a parent pointer per principal; BFS gives the shortest chain, and the visited map prevents infinite loops. 2) Scan policies whose principal is reachabl...