Questions

News feed system design

Design the news feed: users post, follow people, and scroll a feed of the newest posts.

Play

The problem

A news feed shows each user the newest posts of the people they follow, like the home screen of a social app.

When you open the app, your feed loads. When you post, your followers see it in their feeds.

Questions to ask the interviewer

What is in scope?

  • Post, follow, and read a feed, newest first, a page at a time.
  • Not in this problem: likes, comments, ranking, ads, private posts.

How fast must it be?

Under 300 ms on average, for 99% of the feed reads and posts.

How many reads and posts?

  • 200 requests a second today; 99% of them are feed reads.
  • People read far more than they post: reads win.

How many people does a user follow?

About 10 today. It will grow.

How fresh must a feed be?

A new post may take up to a minute to show. Nobody waits for it.

How much data?

A feed keeps the newest 200 post ids, about 2 KB a user: small enough to keep ready for everyone.

Want to try it yourself first? Play, then come back for the approach.

Play

The design in short

A news feed looks like one query: find the people I follow, get their newest posts, sort them, and show the first page. At small size that works well. The interview is about what that query costs when everyone runs it all day.

The main question is when a feed is built. Is it put together at read time, when someone opens the app? Or is it ready ahead of time, before anyone asks? Each answer moves work to a different moment and a different part of the system. Write down where the work goes in each case, and what it costs, before you pick.

A feed is small. The newest 200 post ids per user is about 2 KB. Notice how little that is per person. A small, often-read piece of data changes what a fast read can look like.

Components to weigh:

  • the app machines taking feed reads and new posts
  • where posts and follows are stored for good
  • how many lookups one feed read makes, and where each one goes

Read the brief closely. Count how much of the traffic is feed reads and how much is posts. Note how fresh a feed must be, and what the user does while a new post spreads. These facts are the requirements that matter most here, more than any single part.

Reason about scale with the follow count. Multiply reads a second by the people a user follows. That number is the work your read path does today. Then check that each part on that path can carry it, with some room spare. Spare room is what carries you through a busy hour.

Likes, ranking and ads are out of scope here; each would change a feed a lot. The game turns your answers into a board you can run.

Play

Last updated 22 October 2026