HLDArena
HLD-242·Geo & Telemetry
Medium · 1,000 pts

Fitness GPS Activity Stream & Route Segment Leaderboard

Design a Strava-style workout ingestion and route-segment matching backend that stores compressed GPS polyline streams, detects traversed climb/sprint segments asynchronously, and updates ranked KOM/QOM leaderboards.

Max p99
≤ 52 ms
Availability
≥ 99.6%
Budget
≤ $5,300

Functional Requirements

  • FR-1POST /v1/activities — Uploads workout metadata + GPS telemetry stream and enqueues asynchronous spatial segment matching.
  • FR-2GET /v1/segments/{segment_id}/leaderboard — Returns top overall, age-group, and friend effort times for a popular road/trail segment.
  • FR-3DELETE /v1/activities/{activity_id} — Removes deleted or privacy-flagged workouts and purges their efforts from segment leaderboards.
  • FR-4Must absorb Sunday-morning marathon upload bursts without degrading live segment leaderboard and feed reads.

Workload Profile

Weekday Workouts32,000 Feed & Segment Read RPS / 5,200 GPS Upload Write RPS
Weekend Marathon Finish Surge86,000 Read RPS / 15,000 Upload Write RPS
Active Working Set28 GB hot segment sorted leaderboards & spatial bounding-box index
Traffic DistributionHeavy Zipfian skew on iconic city park & climb segment_id boards

Consistency Model

Immediate activity receipt with bounded eventual (< 5s) async segment-effort matching and leaderboard rank updates.

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
2,000 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 104 ms
• Availability: ≥ 99.6%
Valid end-to-end Client → Compute → Storage topology