HLD-131·Caching & Consistency
Easy · 500 ptsOAuth 2.0 Authorization Code & PKCE Token Issuer
Design an OAuth 2.0 / OIDC authorization-code exchange and JWKS public-key endpoint that verifies PKCE challenges, enforces single-use auth codes, and serves high-QPS token validation keys.
Max p99
≤ 32 ms
Availability
≥ 99.5%
Budget
≤ $3,200
Functional Requirements
- FR-1POST /oauth/token — Verifies PKCE code_verifier against stored challenge, consumes auth_code atomically, and issues signed access + refresh tokens.
- FR-2GET /.well-known/jwks.json — Serves current signing public key set for downstream resource-server JWT verification.
- FR-3POST /oauth/revoke/{token_id} — Revokes refresh tokens or compromised grants and updates revocation caches.
- FR-4Must prevent auth_code replay (read-after-write consumption) and sustain 99.5%+ availability during primary store failover.
Workload Profile
Baseline Auth Traffic22,000 JWKS & Introspect Read RPS / 2,800 Token Exchange Write RPS
Morning SSO Login Surge58,000 Read RPS / 7,500 Write RPS
Active Working Set10 GB short-lived PKCE auth codes & active refresh grants
Security InvariantStrict single-use auth_code consumption + JWKS edge caching
Consistency Model
Read-after-write on single-use auth_code redemption and refresh-token rotation so a redeemed code cannot be replayed.
Relevant practice for
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words