HLDArena
HLD-201·Caching & Edge
Medium · 1,000 pts

High-Throughput URL Shortener & Redirector

Design a URL shortening and redirection service capable of sustaining extreme read-heavy viral traffic spikes while surviving storage node failures within a tight monthly cloud budget.

Max p99
≤ 45 ms
Availability
≥ 99.5%
Budget
≤ $2,100

Functional Requirements

  • FR-1POST /shorten — Accepts a long URL and persists a unique 7-character short_code mapping.
  • FR-2GET /{short_code} — Resolves the short_code and returns an HTTP 301/302 redirect with minimal latency.
  • FR-3PATCH & DELETE /{short_code} — Allows link owners to update destination URLs or revoke/delete short codes and expire cached redirects.
  • FR-4Active links must remain resolvable during single-node hardware faults within >= 99.5% availability.

Workload Profile

Baseline Load32,000 Read RPS / 1,800 Write RPS
Peak Viral Surge100,000 Read RPS / 5,000 Write RPS
Active Working Set24 GB hot link mappings (500 GB total)
Traffic DistributionHeavy Zipfian skew on viral short_code keys

Consistency Model

Eventual consistency (< 5s propagation) acceptable for reads; newly created short codes must be durably stored.

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