Problem statement
Design the backend that produces each user's home feed (a reverse-chronological-ish stream of posts from the accounts they follow) and keeps it fresh as new posts arrive — think a large social app where a handful of accounts have tens of millions of followers.
Operating context. The graph is roughly 500M users; median user follows ~300 accounts, but the distribution is heavy-tailed — the top 0.01% ("celebrities") have 20M–100M followers each. Post creation runs ~15k posts/sec at peak; feed reads run ~1M feed-open + scroll requests/sec at peak, so the workload is ~60× read-heavy. A feed page is ~20 items; users paginate deep and pull-to-refresh often. Target p99 for a warm feed-open is < 200 ms. Feeds are ranked, not strictly chronological: the top of the feed is scored, the tail may be time-ordered.
Out of scope. Post authoring/media upload pipeline, the ranking ML model itself (assume a scorer service exists that returns a score for a (viewer, post) pair), notifications, DMs, ads insertion, spam/abuse filtering, and the social-graph write path (assume follow/unfollow edges already live in a graph store you can query).
What to produce. A high-level architecture covering: the two fan-out strategies (push/write-time vs pull/read-time) and where you draw the hybrid line for celebrity authors; the feed-store data model and how a page is assembled and ranked; pagination + freshness (stable cursors while new posts arrive); backfill when a user follows someone new or a cold feed must be rebuilt; and the cache layers on the read path. Sketch the major components and the request flow for both post-create and feed-open, and be explicit about the celebrity/hot-user problem — we will probe it in checkpoints.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design HLD
- Scaling Fanout
- Scaling Read-Heavy
- Data Cache
- Consistency Eventual