Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Ranked Hybrid Social Feed

Design a scalable ranked feed that combines queued fanout, read-time merging, bounded inbox history, and immediate visibility for a user's own posts.

Problem statement

For this exercise, assume users publish immutable short text posts, follow or unfollow authors, and page through a ranked home feed. Ordinary-author posts are asynchronously fanned out as lightweight inbox references with versioned rank scores, while high-fanout author streams are merged and reranked during reads.

Retain only a bounded recent inbox history per user, cache active users' first pages, and make a user's own accepted post visible to that user immediately even while queued fanout is pending.

Publish retries and at-least-once delivery must converge on one post and one inbox reference, and subsequent reads must exclude authors the user has unfollowed. Ads, comments, reactions, reshares, search, media processing, private-account approvals, notifications, and model training are outside scope.

What to build

  1. For this exercise, an authenticated user can idempotently publish an immutable short text post, receive a stable post ID, and immediately see that post in their own feed.
  2. For this exercise, a user can follow or unfollow another author, and subsequent feed reads use the current follow relationship.
  3. For this exercise, a user can page through a deduplicated ranked feed assembled from bounded inbox references and eligible read-time author streams.

At scale

  • For this exercise, assume 30 million daily active users, peaks of 5,000 post publications and 150,000 feed reads per second, and highly skewed read traffic.
  • For this exercise, assume an ordinary author has hundreds of followers while a popular author can have up to 20 million followers.
  • For this exercise, target 300 milliseconds p95 for healthy first-page feed reads and 10 seconds p95 for an ordinary new post to become eligible in follower feeds.
  • For this exercise, keep at most 2,000 recent inbox references per user, retain authoritative posts for one year, survive a single-zone failure, allow at-least-once delivery, and rebuild derived inbox entries from post and follow authorities.