InterviewForge

Design a URL Shortener (like bit.ly)

A complete, top-notch walkthrough for designing a URL shortener: requirements, capacity estimation, base-62 vs hashing, caching, analytics, and the trade-offs that decide the architecture.

Updated 2026-09Easy

Requirements & scope

  • Functional: shorten a long URL to a unique short code; redirect a short code back to the original URL; support optional custom aliases; return the same short code for a repeated long URL (dedup).
  • Non-functional: redirects must be fast (<50ms p99), highly available (redirects are the core product), and short codes should not be guessable if abuse matters.
  • Scale: ~100M new URLs/month, ~10B redirects/month — a 100:1 read-heavy workload.
  • Consistency: it is acceptable for a freshly created short code to take a few hundred ms to be globally readable; redirects must never return a wrong URL.

Out of scope (covered in detail below)

User accounts, custom dashboards, link editing, expiry, and abuse/spam detection — these are real product surfaces; we defer them and discuss how each would be built in the dedicated section.

Unlock the full guide

Premium members get every DSA, system design, company and role interview guide — plus AI practice, mock interviews, and analytics.

Unlock with Premium