← Back
00:00

Inherited Access Rights

Snowflake interview questions · Hard · Coding round · 5 tests

A company models department inheritance as a directed acyclic graph (DAG). If there is an edge parent -> child, then the child inherits permissions from that parent.

Interface

type AccessRule = {
  allow: string; // distinct permission letters to allow directly at this node
  deny: string;  // distinct permission letters to deny directly at this node
};

resolveInheritedAccessRights(
  n: number,
  edges: Array<[number, number]>,
  rules: AccessRule[],
): string[]
Idle