Loading…
Design a URL Shortener is a easy system design interview question covering hashing, caching, databases, scalability — the kind asked at FAANG (Facebook/Meta, Apple, Amazon, Netflix, Google) and AI-first companies like Anthropic, OpenAI, and Nvidia.
Design a system like bit.ly that takes a long URL and returns a short alias. The system should redirect users to the original URL when they visit the short link. Estimate the system handles 100M new URLs per day and 10B redirects per day.
That's it. No further details. This is intentional — your first job is to scope the problem by asking the right clarifying questions.
A classic scoping exercise. Tests whether you can reason about read/write ratios, choose an appropriate encoding scheme, and design a simple but scalable read path. Strong candidates immediately identify this is overwhelmingly read-heavy and design accordingly.
Work through the Clarify phase by asking questions one at a time — just like a real interview.
Each answer reveals why that question matters and how it changes your design decisions.
Once you've clarified enough, unlock the full architecture, calculations, and trade-off analysis.
Use base62 encoding of an auto-increment ID to generate 7-char short codes. Store in a Postgres table with an index on short_code. Put a Redis cache in front for the read-heavy redirect path (99% cache hit rate expected). Use CDN for static assets and a load balancer across multiple app servers.
Design rounds are decided on capacity estimates. Both tools are free.
Longer written walkthroughs of the ideas behind it.
What each one means, and how interviewers probe it.
A full interview loop is more than one round. These are the others, each with what is on the site for it.