System design interview questions
Design a link shortener (URL shortener like Bitly)
"Design a service like Bitly." You ask questions and learn: 20,000 req/s at the peak, and people open links 99 times for every link they create. A link must open fast, and the service must stay up if a machine dies.
Practise this roundFree with an account. A 20 minute timed round in your browser: draw the design, run it against the traffic, then see the interviewer's checklist.
The question
20,000 requests a second at the peak, 1% of them writes. You have 20 minutes and every part on offer: servers, load balancers, caches, databases, queues and more.
How the round works
Like a real interview, the canvas starts empty and the checklist stays hidden until you submit. Bugpit then sends the traffic at your design, crashes a machine, and marks what held up, what fell over and what it would cost each month.
What a strong answer covers
Show it (try the round first)
Size it first: 20,000 req/s at 2,000 per server is 10 servers, plus one spare so a crash doesn't overload the rest.
It's read heavy and the same links are opened again and again, so a cache does most of the work. The database only sees misses and the few writes.
Check what a crash does to the cache. If one of two cache machines dies, half the keys are gone and those reads fall on the database. Either run more cache machines or leave the database room for it.
Don't overbuild. An interviewer notices a design that costs three times what the traffic needs.
The point: A read heavy system is a cache with a database behind it. The marks are in the sizing and in what happens when one machine dies.
More system design interview questions
- Design a chat app (chat app like WhatsApp)
- Design checkout for a flash sale
- Design an app for users worldwide
- Design a news feed (news feed like Twitter or Instagram)
- Design search for a shop
- Design a notification system
- Design a photo store (photo storage like Instagram)
- Design a rate limiter
- Design a payment system