Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Graph-Based Resource Access Platform

Design tenant-aware role-to-resource access queries on a graph projection and migrate safely from an existing database.

Problem statement

For this exercise, assume users are assigned tenant-scoped roles, roles grant access to resources, and an access query returns every resource reachable through those assignments. Nested roles and explicit deny rules are outside scope.

Design a graph schema and service that supports ten million users, one hundred thousand roles, fifty million role-to-resource grants, ten thousand access reads per second, and one hundred assignment or grant writes per second. Healthy access reads target 100 milliseconds p95.

Grants and revocations must become visible within five seconds; an unverifiable decision fails closed.

Also design an online migration from an existing authoritative database: backfill the graph, apply ordered new changes, compare shadow access results, cut reads over gradually, and retain a rollback path until parity is verified.

Cover tenant isolation, bounded traversal, partitioning, caches, hot roles, failure recovery, reconciliation, audit evidence, and observability.

What to build

  1. Authorized administrators can idempotently assign or remove roles and add or remove role-to-resource grants within one tenant.
  2. An authenticated service can page through the resources currently reachable for one user through active role assignments and grants.
  3. Grant and revocation changes become enforceable within five seconds and produce traceable versioned decision evidence.
  4. Operators can backfill, shadow, compare, gradually cut over, roll back, and reconcile the graph projection without planned downtime.

At scale

  • For this exercise, assume ten million users, one hundred thousand roles, and fifty million role-to-resource grants across strongly isolated tenants.
  • Support peaks of ten thousand access reads and one hundred assignment or grant writes per second.
  • Target 100 milliseconds p95 for healthy access reads and five seconds for a grant or revocation to affect new decisions.
  • Keep accepted changes replayable through a zone failure and fail closed when current authorization cannot be verified.