beprodready

greenfield · intro

Design a URL Shortener

Design a URL shortener serving 5,000 redirects/sec with a 100:1 read/write ratio. Survive a viral-link traffic spike and a primary database crash — on a $3,000/month budget.

Steady traffic

5,000 rps

Spike

Budget

$3,500/mo

Functional requirements

  • Shorten a long URL to a unique 7-character code
  • Redirect short URLs to the original with < 100ms p99 latency
  • Track click counts per short URL

Non-functional requirements

  • Sustain 5,000 redirects/sec steady state
  • Survive a 3x traffic spike (viral link) without dropping requests
  • Survive a region-A database outage with < 1% error rate (place replicas elsewhere)
  • Total infrastructure cost under $3,500/month

Failure scenarios the sim will run

  • Launch day steady state
  • A link goes viral (3x traffic)
  • Region A database outage

How you'll be graded

  • Read path absorbs the traffic25% · scalability

    The redirect path must serve 5k RPS steady and 15k during the spike without saturation.

  • Caching is used and justified17% · scalability

    A 99% read workload demands a cache layer; the justification must explain hit-ratio assumptions and invalidation.

  • Survives the region-A database outage25% · availability

    The db-crash scenario kills every region-A database for 60s; reads must continue via replicas in other regions or caches.

  • Within budget, no gold-plating17% · cost-efficiency

    Total monthly cost must be under $3,500; over-provisioning beyond justified headroom loses points.

  • Defends the design17% · justification-quality

    Justifications must state trade-offs (why this store, why this cache, what was rejected).

Start designing →

Best on desktop — the canvas needs room to breathe. Drafts autosave locally.