MediumExperience level: 3-5 years · 8-15 years1 min read

How would you design a social news feed (timeline)?

Reviewed by Gurusankar M.

Asked inAmazonGoogleMicrosoft
#news feed#fanout#timeline#celebrity problem#caching
Report issue

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

  1. How do you rank/order the feed?
  2. Where does caching fit in the feed?
  3. 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.
Open inChatGPTGeminiClaude

Was this answer helpful?

Affiliate links

Equipment for a comfortable, productive setup.

As an Amazon Associate I earn from qualifying purchases.