A high-frequency system design question focusing on read/write fan-out scaling, caching strategies, and handling the "celebrity problem".
A news feed is a constantly updating list of status updates, photos, and videos from entities a user follows. The system consists of two major pipelines:
Fan-out is the process of delivering a post to all followers. The choice of fan-out model is the most important decision in this interview:
When a user posts: the post ID is pushed
immediately to all followers' precomputed
feed lists (stored in a fast Redis cache).
✓ Read path is extremely fast (O(1)).
Just fetch the user's cached feed.
✗ Slow writes for users with millions of
followers (e.g. celebrities). Replicating
one post to 50 million feeds creates
massive write latency/bottlenecks.
When a user loads their homepage: the server
queries the graph DB for their following list,
fetches all posts for those users, and merges/
sorts them in memory.
✓ Write path is O(1) (simply append to user's
post history).
✓ Never duplicates post IDs in caches.
✗ Read path is slow. Aggregating and sorting
posts for hundreds of users on every click
is highly CPU/DB intensive.
Modern social media systems combine both approaches to handle standard users and celebrities efficiently:
Caching is what makes news feeds scale. Standard caches include: