System design interview question · easy · storage · caching · id generation
TinyURL shortener service
Design a URL shortening service like TinyURL. A user submits a long URL and gets back a short alias, such as https://tinyurl.com/y7keocwj. Anyone who opens the short link is redirected to the original URL.
The service should be fast for visitors following links, never hand out the same alias for two different URLs, and keep links working for years.
Practice it as a 50-minute mock interview
- Requirements & scope (7 min): Think like a product manager, translate design question to technical requirements, narrow the scope and write the non-functional requirements as numbers.
- Estimation (3 min): Size the system: estimate the scale it must handle, find the number that drives the design, and name the first bottleneck.
- API & data model (5 min): Write concrete endpoints and entities, and pick stores from access patterns.
- High-level architecture & Data flow (10 min): Start with the simplest design that works and trace a request end to end.
- Deep dives (20 min): Go deep on the 2–3 hardest parts, with alternatives and a reasoned choice.
- Failures, ops & evolution (5 min): Walk each component: what if it dies, slows down, or is overloaded?