quest

Sign in to start training

quest keeps your progress, streaks, and scores tied to your account — so you can pick up on any device.

Synced everywhere. Progress follows you across laptop and phone.
Streaks & stats. See your daily run and every score over time.
Your profile. A name and avatar for the work you do here.

We only use Google to sign you in and sync progress. No posting, no contacts — ever.

System Design Advanced

05  Capstone: URL Shortener

The classic, end to end. A URL shortener looks trivial until the numbers arrive -- which is exactly why it tests everything at once: estimation, key design, storage, caching, and the evolution story when product asks for more.

Step 1 / 2

Design a URL shortener end-to-end for: 100 million new links per month, 10 billion redirects per month, links must keep working for years. Cover: the API, short-key generation (length, alphabet, collision story), the storage schema with a size estimate, the redirect read path with caching, and your QPS numbers.

Hints
  • Numbers first: a month is about 2.6 million seconds. Derive writes/s and redirects/s before drawing anything; the read:write ratio should drive the whole design.
  • Base62 over N characters gives 62^N keys. Pick a length by comparing that keyspace to the links you accumulate over years. Generate from a counter (collision-free, guessable) or randomly (check-and-retry) -- pick one and defend it.
  • The redirect path should almost never touch the database: short-key mappings are immutable, which makes them the easiest thing in the world to cache.
Your design is reviewed against a hidden rubric.