← All Problems
HardSocial Media45 min

Design a News Feed (Facebook/Twitter)

Design a social media news feed that aggregates and ranks posts from followed users and pages.

MetaTwitter/XLinkedInTikTok

Functional Requirements

  • Users see posts from people they follow, sorted by relevance
  • Support text, images, and video posts
  • Near real-time: new posts appear within seconds
  • Handle celebrities with millions of followers
  • Support likes, comments, and shares

Steps (0/6)

Step 1: Clarify Requirements

Scale: 500M DAU. Each user follows ~200 people. Average user scrolls 5-10 feed requests/session. Feed consists of posts from followed users. Key question: Chronological or ranked feed? Usually ranked by relevance (engagement signals, recency, user affinity).

Key Points

  • 500M DAU, ~200 follows per user average
  • Feed generation: ~500M × 10 = 5B feed requests/day
  • Post creation: ~100M new posts/day
  • Feed should be personalized and ranked
1 / 6