HLDArena
HLD-136·Messaging & Queues
Easy · 500 pts

Gamified 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

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
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
1,800 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 76 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology