HLD-136·Messaging & Queues
Easy · 500 ptsGamified User Achievement & Daily Streak Unlock Engine
Design a Duolingo / Xbox-style achievement and daily-streak progression service that ingests lesson/gameplay completion events idempotently, unlocks milestone badges, and serves fast profile trophy showcases.
Max p99
≤ 38 ms
Availability
≥ 99.5%
Budget
≤ $4,750
Functional Requirements
- FR-1POST /v1/users/{user_id}/events — Ingests idempotent activity completion event, increments streak/progress counters, and unlocks earned badges.
- FR-2GET /v1/users/{user_id}/achievements — Returns unlocked badges, current daily streak count, and next milestone progress.
- FR-3PUT /v1/users/{user_id}/streak-freeze — Applies a streak-freeze item or timezone adjustment without double-counting daily completions.
- FR-4Must decouple bursty end-of-day streak completions via async queues and preserve idempotent badge unlocks across retries.
Workload Profile
Daytime Practice Load18,000 Profile Read RPS / 4,200 Activity Event Write RPS
11 PM Midnight Streak Rush48,000 Read RPS / 11,500 Event Write RPS
Active Working Set14 GB active user streak states & badge definitions
Reliability GateIdempotent event_id deduplication + 99.5% availability
Consistency Model
Read-after-write for a user viewing their own newly unlocked streak/badge immediately after lesson completion.
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