Interview Questions/System Design/Social Media News Feed

Social Media News Feed

Preview mode. Log in to write architecture notes, save your answer, and get feedback.

Hard

Social Media News Feed

Design the news feed system for a social media platform like Twitter or Instagram. Functional Requirements: - Users can create posts (text, images, videos) - Users see a feed of posts from people they follow - Feed is ranked by relevance (not just chronological) - Support for likes, comments, and shares - Real-time feed updates when new posts are created Non-Functional Requirements: - Feed generation should be fast (< 200ms) - Support for celebrities with millions of followers - Eventually consistent (new posts appear within seconds) Scale: - 500M users, average 200 follows each - 1M new posts per day - Feed is the most accessed feature (~10B feed loads/day)

Examples

Example 1

How would you handle trending/viral posts that should appear in many feeds?

Approach hint

The key decision is WHEN to build the feed: when a post is created (push) or when a user opens their feed (pull)?

Common mistake

Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.

architecture-notes.md