Skip to content
Backend system design · about 45 minutes

Home feed for a social app

Design the backend of a social app's home feed. Users follow other users, and the feed shows recent posts from the people they follow, newest first. Most users follow a few hundred accounts, but a few accounts have tens of millions of followers. Opening the feed must be fast, and a new post should appear in followers' feeds within seconds.

Ask first

  • Is the feed ordered by time only, or ranked?
  • How many daily users, posts a day, and how many follows does a typical user have?
  • How far back does the feed go, and how many posts are on one page?
  • Can a post be edited or deleted after it reached feeds?
  • Must a new post appear at once, or is a delay of a few seconds fine?

The outline

Write your own outline for each part first.

The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes