6. Design a News Feed
Build a paginated feed that handles high-fan-out authors, fresh posts and visibility changes.
The brief
Design a following-based news feed, starting with reverse chronological order. Follow publication through feed reads and pagination, including a high-fan-out author. Explain how deletion and privacy changes affect precomputed entries before discussing an optional ranked feed.
- There are 10 million daily active users, each opening their feed 20 times/day.
- Publish 20 million posts/day; a few authors have over 5 million followers.
- Users follow and unfollow authors. Authors can delete posts or make their account private.
Constraints
- Feed latency≤ 300 milliseconds
- Declare p95 server latency for a page of 20 entries.
- Visibility enforcement
- Do not expose a deleted or unauthorized post solely because a feed entry was precomputed.
- Pagination contract
- Explain duplicates and omissions when new posts arrive between page requests.
What to cover
- 01
Data and API
Define posts, follows, feed entries and cursors.
- 02
Publication and feed assembly
Show push, pull or hybrid responsibilities and high-fan-out handling.
- 03
Capacity estimates
Estimate feed-read QPS and fan-out work with explicit follow-count assumptions.
- 04
Freshness and privacy walkthrough
Trace a backlog and a privacy change, comparing latency, freshness and write amplification.
Worked designs
Explore the architecture and decisions, then build on an example with Coach.
Review rubric
AI feedback uses these criteria. Scores are practice feedback.
Feed assembly
Publication and reads work for ordinary and high-fan-out authors.
Visibility and pagination
Access changes and cursor behavior are explicit.
Capacity evidence
Read and fan-out estimates support the approach.
Freshness tradeoffs
Backlog recovery and rejected alternatives are explained.
Discussion
Share an approach, ask a question, or tag @Coach.
Loading discussion…