Try
↑ ↓ move↵ openesc close

Interview prep / News feed

Junior · News feed · System design interview question

What is a news feed, and what are the two basic ways to build one?

Sketch your own answer first, then compare it with the one below.

A strong answer

A feed shows a reader the recent posts of the accounts they follow, newest first.

Fan-out on write, or push, copies each new post into the inbox of every follower. Reads are one lookup. Fan-out on read, or pull, builds the feed when it is opened by fetching recent posts from each followed account. Writes are cheap and reads are heavier.

Sources

Learn it by running it

The design a news feed lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms