Part 1 of 7 · 1 min read
Why this page comes fourth in Level 10
In this module you will
- Turn "design tinyurl" into requirements and a short list of assumptions.
- Work out writes per second, reads per second, records and storage, and catch an arithmetic slip.
- Choose a code length from the alphabet size and the number of records.
- Compare "hash and fix collisions" with "counter and base 62", and say why the second wins here.
- Explain the redirect flow, the cache, and why 301 and 302 behave differently.
A URL shortener is the classic warm-up case study. The design is small, but every part of it is a decision: how long the code is, where the code comes from, and what status code to send back. It reuses the unique ID generator from module 2 and the cache ideas from Level 3. The book used is "System Design Interview" by Alex Xu, chapter 8. The numbers marked "made up" only show the idea, and all arithmetic here was checked with a script.