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

Real-Time Product Clickstream & Funnel Analytics Store

Design an Amplitude / Mixpanel / Google Analytics real-time event ingestion and conversion-funnel query service for high-traffic web/mobile apps.

Max p99
≤ 70 ms
Availability
≥ 99.4%
Budget
≤ $5,700

Functional Requirements

  • FR-1POST /v1/collect — Ingests user clickstream events partitioned by project_id + user_id.
  • FR-2GET /v1/funnels/{project_id} — Queries live 1-hour conversion and retention rollups.
  • FR-3PATCH & DELETE /v1/collect/{project_id} — Updates, revokes, or deletes project_id entries with bounded TTL or explicit cache/index invalidation.
  • FR-4Must buffer Super Bowl / Black Friday clickstream spikes and survive primary rollup DB crashes.

Workload Profile

Steady SDK Events18,000 Dashboard Read RPS / 15,000 Event Write RPS
Campaign Launch Spike48,000 Read RPS / 38,000 Event Write RPS
Active Working Set26 GB HyperLogLog & hourly funnel rollup cubes
Traffic DistributionHeavy skew on flagship enterprise project_id dashboards

Consistency Model

Eventual streaming rollup lag (< 5s) acceptable; zero lost accepted analytics batches.

Design Write-up
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 ≤ 140 ms
• Availability: ≥ 99.4%
Valid end-to-end Client → Compute → Storage topology