HLD-114·Storage & Caching
Easy · 500 ptsSMS & Email One-Time Passcode (OTP) Verifier
Design a short-TTL one-time passcode generation and verification service handling sudden mobile re-authentication waves.
Max p99
≤ 35 ms
Availability
≥ 99.5%
Budget
≤ $2,150
Functional Requirements
- FR-1POST /otp/send — Generates a 6-digit hashed code with 5-minute TTL and enqueues SMS/email dispatch.
- FR-2POST /otp/verify — Validates submitted code and attempt count for phone_hash.
- FR-3DELETE /otp/send/{phone_hash} — Supports tenant retention TTL expiry, rule updates, or stream cleanup while keeping recent rollup caches fresh.
- FR-4Must remain available across a primary state store crash.
Workload Profile
Baseline Logins14,000 Verify RPS / 4,500 Issue Write RPS
Push Campaign Surge40,000 Read RPS / 14,000 Write RPS
Active Working Set5 GB active 5-minute OTP & attempt counters
Traffic DistributionBroadly distributed across phone_hash identities
Consistency Model
Short-lived TTL state replicated across multi-AZ nodes so login checks survive node faults.
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.
Design Write-up
0 boxes · 0 edges
0 words