URL shortener with caching and analytics
Build a URL shortener like the ones used for links in messages, with a cache for popular links and click counts, then explain how you would scale it.
What this proves to recruiters
- You can design for scale, a common interview topic.
- You understand caching and databases.
- You can explain trade-offs clearly.
Skills you will use
- System design
- Caching (Redis)
- Databases
- APIs
What you need
Nothing to buy: this project only needs a computer and the free software below.
Free software
- Python, Node.js or Go
- Redis
- SQLite or PostgreSQL
Steps
- Design the API: create a short code for a URL, and redirect from the code.
- Generate codes by encoding an ID in base 62 (a–z, A–Z, 0–9).
- Store mappings in the database and cache popular ones in Redis.
- Count clicks without slowing down the redirect.
- Load-test it and measure requests per second with and without the cache.
- Write a one-page design note: how you would handle 100 million links.
Make it stand out
- Add custom aliases and expiry dates.
- Add rate limiting to stop abuse.
Put it on your resume
Built a URL shortener with base-62 codes, Redis caching and click analytics; cache raised throughput from [x] to [y] requests/s.
Replace each [x] with a number you measured. Real numbers make a line believable.
Keep going
This project fits stage 3, “Development and projects”, of the Software engineering roadmap. See also how freshers get into associate software engineer jobs.