← Articulet System Design, Made Clear Chapter 14 · News Feed
Part 4 · Real Interview Systems Chapter 14

The news feed.

Serving a feed that feels fresh without rebuilding the whole world every time.

Learning objective
Design a news feed by separating post creation, feed reading, ranking, media delivery, and fan-out trade-offs, and explain when to compute feeds on write, on read, or with a hybrid model.
Before you read

Make a prediction first.

Predict

Answer before the explanation.

What makes a feed expensive: writing posts, reading posts, ranking posts, or delivering celebrity updates?

Commit

Write a rough answer.

Before reading, decide whether you would build the feed on write, on read, or with a hybrid.

Connect

Notice where it returns.

Feeds interleave storage, fan-out, ranking, caching, and freshness trade-offs.

Plain English

A feed is not just stored posts. It is assembled on read.

To the user, a news feed looks simple: open app, see posts. Underneath, the expensive part is usually building the feed, not storing the post itself.

The system may need to know who the user follows, gather candidate posts, rank or sort them, attach media, and paginate the result. That is why a feed is really a read model, not just a table lookup.

Reasonable v1 scope
  • Users follow other users.
  • Users create posts.
  • Readers open a feed of recent posts.
  • Media is stored separately and served through a CDN.
Layer on later
  • Ranking.
  • Celebrity handling.
  • Recommendations.
  • Ads.
  • Notifications.

The key design question is simple to say and important to answer: do I prepare the feed when the post is written, when the user reads it, or somewhere in between?

Why it matters in interviews

This problem reveals whether you understand feed assembly, not just post storage.

Interviewers use news feed because it forces candidates to talk about read-heavy behavior, fan-out on write versus fan-out on read, caching, ranking, hot users with huge follower counts, and media delivery.

Weak opener
Store posts in a database and fetch them for the user.
Strong opener
The expensive part is building the feed itself. For ordinary accounts, I may push recent posts toward follower feed entries when the post is created. For very large accounts, that can become too expensive, so I may assemble those parts on read or use a hybrid model.

The stronger answer names the real bottleneck: assembling the feed efficiently under different follower shapes.

Mental model

Prepack, assemble live, or mix the two.

A feed can be a prepacked tray, a made-to-order plate, or a hybrid service.
Prepacked tray fan-out on write Made-to-order plate fan-out on read Hybrid service prep finish normal users + celebrity exception
Prepack means faster reads and heavier writes. Assemble live means lighter writes and heavier reads. Hybrid usually wins once follower shapes become uneven.
Key ideas

Seven anchors.

Core diagram

Separate the post lane from the read lane.

POST LANE READ LANE A Author Post service writes post + metadata Post store source posts Feed fan-out normal users precompute feed entries Feed store recent entries celebrity exception R Reader Feed service assemble page Candidate builder feed store or post scan ranking / ordering Feed cache recent fragments CDN media
Keep post creation, feed assembly, and media delivery distinct. That separation makes the trade-offs easier to reason about.
Speaking script

Lines you can actually say out loud.

Opening
The key question in a feed system is where the feed is assembled: on write, on read, or with a hybrid model.
Sketching
If I precompute more at write time, feed reads get faster but writes become heavier.
Sketching
If I compute more on read, writes stay lighter but every feed open becomes more expensive.
Deep dive
For very large accounts, pure fan-out on write can become too expensive, so I would use a hybrid path.
Extending
Media delivery should be separated from feed metadata and served through a CDN.
Defending
The trade-off here is freshness and fast feed reads versus write amplification and system complexity.
Common mistakes

Predictable ways this answer goes wrong.

Misconception check

Correct the wrong model before it sticks.

Wrong intuition

What feels tempting

A feed is just a query for posts from people you follow.

Better model

What to replace it with

A feed is a delivery and freshness problem shaped by fan-out, ranking, celebrity accounts, and latency expectations.

Interview move

What to do in the room

Choose fan-out-on-write, fan-out-on-read, or hybrid based on relationship graph and freshness needs.

Trade-offs

The decisions that come up every time.

Feed strategyGood whenWeak whenInterview line
Fan-out on write Most users have moderate follower counts and fast reads matter a lot. Some accounts have massive fan-out and post frequently. Fan-out on write makes feed reads simpler, but it can explode for celebrity-style accounts.
Fan-out on read Writes should stay light and follower graphs are large or uneven. Feed opens become expensive and repeated reads are slow. Fan-out on read keeps writes cheap, but I pay more on every feed load.
Hybrid fan-out Default Normal users benefit from precomputation, but very large accounts need special handling. The added complexity is not justified at small scale. A hybrid model lets me keep common reads fast without pushing every large fan-out cost into the write path.
Pure live ranking on read Ranking needs maximum freshness and the scale is still modest. Read latency and compute cost become too high. I would only rank everything live if the scale is still small enough to afford it.
Cached feed fragments Users reopen feeds frequently and repeated reads are common. Feed contents are too dynamic or freshness requirements are extremely strict. Caching feed fragments helps when many users refresh similar recent results repeatedly.
Deep dive

Fan-out on write, fan-out on read, or hybrid?

This is the core trade-off in the chapter. The right answer is usually not ideological. It depends on follower shape, read latency goals, and how much write amplification you can afford.

Fan-out on write heavier writes, lighter reads New post Feed A Feed B Feed C Feed D Fan-out on read lighter writes, heavier reads New post Read-time builder gather, sort, rank, paginate Hybrid ordinary users precompute, celebrities defer New post Normal users precompute feed entries Celebrity path inject more at read time
The hybrid answer is usually the most interview-realistic because follower distributions are uneven in real systems.
Mini case study

A celebrity with 50 million followers posts once.

This is the pressure test. If your answer still uses pure fan-out on write for everyone, the design breaks at the write path.

What goes wrong

  • The system may try to push one post into millions of follower feed entries immediately.
  • Write amplification becomes the bottleneck.

What helps

  • Store the post once.
  • Mark it as available to followers.
  • Assemble or inject it more selectively on read for extremely large audiences.

What still stays useful

  • Precomputed feed entries for ordinary users.
  • Cache for repeated feed openings.
  • CDN for media in the post.

The lesson

  • One strategy rarely fits every user class in a feed system.
Demo conversation

How a strong exchange sounds.

Interviewer
What is the real cost in a feed system?
Candidate
Usually feed assembly, not post storage. The system pressure comes from deciding when and where to build each follower's feed.
Interviewer
So how do you choose between fan-out on write and fan-out on read?
Candidate
I choose based on follower shape and traffic shape. Ordinary users often work well with more write-time precomputation, while celebrity-scale accounts push me toward a hybrid or more read-time assembly.
Interviewer
What would you optimize first?
Candidate
I would first make the baseline feed retrieval path clear, then optimize the assembly bottleneck with caching and the right fan-out strategy for different user classes.
Worked example to solo answer

Fade the support before the real practice.

Do not jump straight from reading to a full answer. First see the shape, then complete part of it, then answer alone.

I do

Study the model move.

I would say: "For ordinary users I can precompute fan-out, but celebrity posts may need pull-time handling."

We do

Complete the missing piece.

For a chronological feed, decide what gets precomputed and what is merged at read time.

You do

Answer without notes.

Answer the practice prompt and name the feed-building strategy explicitly.

Practice

Try it before you read the model answer.

Prompt
Design a feed that is chronological, not ranked.
  • What gets simpler?
  • Would you lean more toward write-time or read-time work?
  • What bottleneck still remains?
Show a strong model answer
A chronological feed removes most ranking logic, so the main cost becomes assembling recent posts from followed users efficiently. I would still think about whether to precompute feed entries for ordinary users or build them on read, but the logic is simpler because I no longer need heavy ranking signals on every request. The remaining bottleneck is still feed assembly and fan-out, especially for users who follow many accounts or for accounts with huge audiences.
Training loop

Make this chapter stick.

Before moving on, turn recognition into production. Close the model answer, answer from memory, then retry one small slice.

Recall

Say the chapter's core idea without looking. Then name one related idea from an earlier chapter.

Vary

Change one constraint in the practice prompt and answer again in half the time.

Score

Use the rubric to pick one dimension below 3, then retry only that dimension.

Memory hook
Prepack, assemble live, or mix the two.
Recap

Three things to take into the room.

1

The real cost is assembling the feed.

Not storing posts.

2

Write-time and read-time work trade against each other.

You are moving cost, not eliminating it.

3

Celebrity accounts usually force a hybrid answer.

Follower shape matters as much as average traffic.

Reusable interview line
"I would separate post storage from feed assembly, then choose where to pay the cost: more at write time, more at read time, or a hybrid path for celebrity-scale fan-out."