System design interview questions
Design a notification system
"Design the system that sends our emails and push messages." You ask questions and learn: 5,000 req/s, and 1 in 10 triggers a notification, 500 a second. Nobody using the app should wait for a message to be sent, and no message should be lost if the email provider is slow.
Practise this roundPart of Bugpit Pro. A 25 minute timed round in your browser: draw the design, run it against the traffic, then see the interviewer's checklist.
The question
5,000 requests a second at the peak, 10% of them writes. You have 25 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)
Sending a message means calling an outside provider, and outside providers are slow and sometimes down. If your app calls one while a user waits, their slowness becomes yours.
Put each notification in a queue and answer the user at once. Workers send them afterwards, and a slow provider only makes the queue longer for a while.
Workers will sometimes send the same job twice after a crash. Give each notification an id and skip ones already sent, or people get the same email twice.
Mention what a real system adds: each person's preferences, a limit on how many messages one person gets, and a separate queue for urgent messages such as login codes.
The point: A notification system is a queue with a provider at the end of it. The design is simple, and the marks are in duplicates, limits and priorities.
More system design interview questions
- Design a link shortener (URL shortener like Bitly)
- 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 photo store (photo storage like Instagram)
- Design a rate limiter
- Design a payment system