ScaleCrafts

Design a social news feed

Show each user a timeline of recent posts from the people they follow, like Twitter or Instagram.

Functional requirements

  • Publish a post with text or media
  • See a feed of posts from people you follow
  • Feed is sorted newest first and paginated

Non-functional requirements

  • Feed loads in under 200 ms
  • New posts appear within a few seconds
  • Accounts with millions of followers work

Scale

  • 300M daily active users
  • Each user follows about 200 accounts
  • Feeds are read 50 times more than posts are written

How you’ll be scored

9 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works

What interviewers look for

  • Clarify before you draw. State what is in and out of scope. For “Design a social news feed”, that starts with: Publish a post with text or media; See a feed of posts from people you follow; Feed is sorted newest first and paginated. Interviewers notice candidates who pin the requirements down first.
  • Turn the scale into numbers. The scale (300M daily active users; Each user follows about 200 accounts; Feeds are read 50 times more than posts are written) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
  • Show how each quality is met. Your design should visibly deliver: Feed loads in under 200 ms; New posts appear within a few seconds; Accounts with millions of followers work. Saying that it does isn’t enough; point to the part of the design that makes it true.
  • Expect follow-ups on the hard parts. Interviewers usually probe fan-out, queues and caching here. This is a medium problem, so interviewers expect you to weigh two reasonable options, such as consistency against latency, and to say why you picked one.
  • Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.

Related problems

Loading your workspace…