Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Role-Based Token Authorization Platform

Design a tenant-aware authorization platform that distributes role policy through short-lived tokens and enforces operation-level access safely.

Problem statement

For this exercise, assume an existing identity provider authenticates users.

A tenant administrator defines roles as named permission sets, assigns tenant-scoped roles to users, and protected APIs authorize a named operation on a resource only after validating an audience-bound signed access token and the current authorization state. Tokens expire within 15 minutes.

A role removal or policy change must stop newly unauthorized operations within 60 seconds, signing keys rotate without accepting unknown keys, and an unverifiable decision fails closed. Denied and privileged operations produce durable audit evidence.

Design the policy and assignment model, administration APIs, token issuance and claims, key distribution, service-side enforcement, revocation and change propagation, caches, availability, multi-tenant isolation, audit, failure recovery, and observability.

Password authentication, user provisioning, resource business logic, billing, and enterprise federation are outside scope.

What to build

  1. An authorized tenant administrator can idempotently create or update versioned roles and assign or remove them from tenant-scoped users.
  2. An authenticated user can receive a short-lived audience-bound signed token whose authorization claims are traceable to a tenant policy and assignment version.
  3. A protected API can allow or deny a named operation on a resource with low latency while failing closed on invalid, unknown, stale, or cross-tenant authorization state.
  4. A role or assignment change stops newly unauthorized operations within 60 seconds and privileged or denied decisions remain available for authorized audit review.

At scale

  • For this exercise, assume 10 million users across 100,000 tenants with strongly isolated policy and assignment namespaces.
  • For this exercise, assume peaks of 100,000 authorization checks and 1,000 role or assignment changes per second.
  • For this exercise, target 20 milliseconds p95 for healthy service-side authorization and 99.99 percent monthly enforcement availability.
  • For this exercise, apply role removal or policy change to new protected operations within 60 seconds and retain privileged and denied audit decisions for one year.