A news feed that stays fast at 10 million users: a system design interview question
A social app builds each feed when you open it. At 10 million users that is far too slow. It is a mid-level question of about 40 minutes, and it starts from a system that already works, which is how many real design interviews begin.
How do I approach the a news feed that stays fast at 10 million users question?
To design a news feed, choose between building feeds when posts are written, which gives fast reads and heavy writes, or when they are read, which is the reverse. Most designs push posts to ordinary followers' feeds, pull posts from very popular accounts at read time, and merge both.
Practise this design interview
The situation
A social app stores posts and follows in a SQL database. When someone opens the app, the server finds everyone they follow, fetches their recent posts and sorts them. That is fine for the first ten thousand users.
What you are asked to design
The app now has 10 million daily users, some people follow thousands of accounts and a few accounts have millions of followers. Feeds must load in under half a second, and a new post should show up for followers within a few seconds. Design the feed.
Questions worth asking first
Is the feed chronological or ranked?
How many posts should a feed hold, and how far back can a user scroll?
How fresh must it be: seconds, or is a minute acceptable?
Are there accounts with very large followings, and should they be treated differently?
Where interviewers dig
Fan-out on write versus fan-out on read, and a hybrid for very popular accounts.
Storing precomputed feeds and trimming them.
Pagination that does not skip or repeat posts as new ones arrive.
What a strong answer covers
Names the core trade-off: precompute each follower's feed when a post is written (fast reads, heavy writes) or assemble it when read (cheap writes, slow reads).
Proposes a hybrid: push to followers' feeds for ordinary accounts, pull at read time for accounts with huge followings, and merges the two.
Stores feeds as bounded lists in a fast store, fed by a queue and workers so a post does not block on delivery.
Uses cursor-based pagination and handles deleted or blocked posts when reading.
Traps that cost points
Fanning out a celebrity's post to millions of feeds synchronously.
Offset pagination that shows duplicates when new posts arrive.
Ignoring inactive users: precomputing feeds for people who never open the app wastes the most work.
How the practice works here
It works on a laptop or desktop, not on a phone: the canvas and the interviewer's view of your drawing need the screen space.
You talk with the interviewer by voice, and the canvas already shows the company's system as it is today. You extend it, and the interviewer sees what you draw. A button pauses your microphone when you want to think or sketch in silence; the interviewer waits.
When the time is up you get a report: a hire or no-hire call for the level, ratings for problem navigation, solution design, technical depth and communication with a quote from your own answer for each, what to fix, and the points a strong answer covered that yours did not. Your first interview on giveinterview, of any kind, is free, and every interview report is free. After that a design interview costs credits at the same per-minute rate as a role interview, and playing duels earns credits you can spend on it.
Frequently asked questions
How long is this design interview?
About 40 minutes, the length of a typical mid-level design round.
Can I do it on my phone?
No. System design practice needs a computer screen for the canvas, so it is for laptops and desktops only.
Do I have to draw?
Yes. The canvas starts with the current system and the interviewer sees what you add, as at a whiteboard. You can pause your microphone to sketch and explain afterwards.
Is it free?
Your first interview on giveinterview, of any kind, is free, and every interview report is free. After that a design interview costs credits at the same per-minute rate as a role interview, and playing duels earns credits you can spend on it.
Keep reading
- Short links with click analytics: a system design interview question
- A rate limiter for a public API: a system design interview question
- Real-time chat with delivery receipts: a system design interview question
- A reliable notification system: a system design interview question
- Selling tickets without selling a seat twice: a system design interview question
- Matching riders with nearby drivers: a system design interview question
- A payments ledger you can trust: a system design interview question
- Practice interview online, with an interviewer that answers back
- Company interview guidesRounds and questions by company