Resolve Effective File Access Through Nested and Cyclic Groups

Last updated: November 29, 2026

Quick Overview

Files carry ACLs listing users and groups, and groups can contain users and other groups, including membership cycles. Return, for every file, the full set of users who can actually access it.

Concentric Ai
Coding & Algorithms
Software Engineer
Concentric Ai
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Files carry ACLs listing users and groups, and groups can contain users and other groups, including membership cycles. Return, for every file, the full set of users who can actually access it.

Answering 'who can really open this contract' is central to DSPM, because directory groups in Active Directory and Microsoft 365 nest deeply and sometimes loop. The interviewer looks for graph modeling, cycle safety, and reuse of work across many files instead of a fresh traversal per file.

What the Interviewer Expects
  • Model groups as a directed graph and recognize cycles
  • Avoid infinite loops and repeated traversal per file
  • Collapse cycles (SCCs) or memoize safely
  • Process components in dependency order
  • Discuss time and memory in terms of groups, edges and users
Key Topics to Cover
Graph traversal
Strongly connected components
Memoization
Access control
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you incrementally update results when one membership edge is added?
  • Member sets can be huge (all-employees); how would you represent them compactly?
  • How would you also report the shortest membership path explaining why a user has access?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: acl: file -> [principal] and membership edges (group, member). Output: file -> sorted users. Groups may be missing (empty), nested arbitrarily deep, and cyclic (eng contains infra co...

High-Level Design

Plain DFS with memoization breaks on cycles: a group in the middle of a cycle would cache an incomplete set. Instead, compute strongly connected components with Tarjan's algorithm. Every group in one ...


Submit Your Answer
Markdown supported

Related Questions