Loading…
While this loads — quick one
Every subscriber must get each event. A queue, or pub/sub?
Loading…
While this loads — quick one
Every subscriber must get each event. A queue, or pub/sub?
Loading the question…
While this loads — quick one
Every subscriber must get each event. A queue, or pub/sub?
System design interview question
TinyURL, bit.ly, t.co: “design a URL shortener” is often the first system design question you get, because it is small enough to finish and still has real decisions in it — how codes are made unique, how long they are, and how a redirect stays instant when one link is opened thousands of times a second. Here is how to walk into it, and then how to practise it until the answer is yours.
Practise URL Shortener (TinyURL)
Free with an account.
A team is building a link shortener. A user pastes a long URL and gets back a short link; anyone who opens the short link is redirected to the original address. Every short link must carry a code that is unique across the whole system, and the service will hand out billions of them over time. The mappings from code to URL are tiny, never change once written, and are looked up far more often than they are created — a popular link can be opened thousands of times a second. Redirects have to feel instant even under that read load, while creating a link can be a little slower.
Every phrase that matters in the brief is a requirement in disguise. Spot them before you draw a single box.
“a code that is unique across the whole system”
A way to mint identifiers that never collide, without a single central counter everyone waits on.
“looked up far more often than they are created”
A read-heavy store that scales out for tiny key→value rows.
“Redirects have to feel instant even under that read load”
An in-memory cache in front of the store for the hottest links.
The same design always gets the same score, with the reason behind every requirement — then defend it against the trade-offs above.
The answers are not on this page on purpose. Build the design, and these are asked — and marked — once it is submitted.
© 2026 PlayCloudLabs. All rights reserved. Not affiliated with Amazon Web Services.