How would you design a social news feed (timeline)?
Reviewed by Gurusankar M.
Short Answer
Two models: fan-out-on-write (push each post into followers' precomputed feeds — fast reads, expensive for users with many followers) and fan-out-on-read (assemble the feed from followees at read time — cheap writes, slower reads). Real systems use a hybrid: push for normal users, pull for celebrities.
On this page
Concept Made Simple
Coffee Chat Question
“How would you design a social news feed (timeline)?”
Remember It Faster
Mind Map Answer
- Fan-out-on-write
- push to follower feeds — fast read
- Fan-out-on-read
- assemble at read — cheap write
- Celebrity
- millions of followers breaks push
- Hybrid
- push normal, pull celebrities
Think Beyond the Expected
What If?
A celebrity with 50M followers posts — why does pure fan-out-on-write fall over?
One post triggers 50M feed writes — a massive, slow write amplification that can lag or overwhelm the system. The hybrid fix: don't fan-out celebrity posts on write; instead pull their recent posts at read time and merge into each follower's feed. Push for the long tail, pull for the few huge accounts.
Real World
Twitter/Instagram-style feeds use hybrid fan-out with heavy caching of precomputed timelines; the 'celebrity/hot-key' problem is the classic reason pure push doesn't scale.
Interviewer's Expectation
Keywords they're listening for:
- fan-out write vs read
- write amplification
- celebrity problem
- hybrid approach
- feed caching
Common Mistakes
- Pure fan-out-on-write ignoring celebrities
- Pure fan-out-on-read (slow feeds at scale)
- No caching of precomputed timelines
Best Practices
- Hybrid push/pull by follower count
- Cache precomputed feeds
- Handle hot keys explicitly
Follow-up Questions
- How do you rank/order the feed?
- Where does caching fit in the feed?
- How do you handle the hot-key/celebrity case?
Continue Learning with AI
Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.
Plain-language foundations
I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner. Topic: Scaling (System Design) Interview question: "How would you design a social news feed (timeline)?" Please: 1. Explain the core idea in simple, plain language, using an everyday analogy. 2. Define any technical terms you use. 3. Walk through one small, concrete example. 4. Finish with a single sentence I can easily remember. Keep the tone friendly and assume I'm new to this topic.
Was this answer helpful?
Affiliate links
Tools for Your Developer Workspace
Equipment for a comfortable, productive setup.
As an Amazon Associate I earn from qualifying purchases.
- MonitorView on Amazon : BenQ EW2790U 27-inch Monitor (opens in a new tab)
BenQ EW2790U 27-inch Monitor
- LaptopView on Amazon : Acer Aspire One Laptop (opens in a new tab)
Acer Aspire One Laptop
- Office ChairView on Amazon : Wakefit Gravita Ergonomic Office Chair (opens in a new tab)
Wakefit Gravita Ergonomic Office Chair