System Design AI
Design brief
Product & backendIntermediate45 min suggested

Design a News Feed

Build a paginated feed that handles high-fan-out authors, fresh posts and visibility changes.

Backend and product engineers designing software behavior.

Your approach: Use diagrams, tables or prose for customer contracts, state transitions and data ownership; include APIs only to the depth the question requests.

The problem

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.

Work within these constraints

Feed latency

Declare p95 server latency for a page of 20 entries.

Required target: ≤ 300 milliseconds

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 deliver

1

Data and API

Define posts, follows, feed entries and cursors.

2

Publication and feed assembly

Show push, pull or hybrid responsibilities and high-fan-out handling.

3

Capacity estimates

Estimate feed-read QPS and fan-out work with explicit follow-count assumptions.

4

Freshness and privacy walkthrough

Trace a backlog and a privacy change, comparing latency, freshness and write amplification.