call(back)

Design Pinterest's Home Feed

Design the Pinterest home feed. When a user opens the app they see a personalized, infinitely scrollable grid of pins drawn from boards they follow and from recommendations. It has to feel fresh, never repeat, and load fast for hundreds of millions of people.

Assume a scoring model exists — your job is retrieval, serving, freshness, and state. The feed is mostly recommendations, not followed content, which should make you suspicious of pure fan-out-on-write. Target: first page p99 under ~400 ms end to end, four nines of read availability, new pins eligible within minutes, and in-session feedback (hide, save) influencing later pages.

Cover: the retrieval-to-ranking funnel and why you cannot score the corpus online, pagination without repeats, the push/pull/hybrid decision for followed boards, and what degrades when each dependency fails. Ads insertion, model training, and moderation are out of scope.

Hints

Hint 1

Do the math first: 640M MAU → ~160M DAU → ~45k QPS peak. If each request scored 3k candidates with a heavy model that's 135M evaluations/s — impossible. The number forces a funnel: retrieve thousands → light score → heavy score hundreds.

Hint 2

Pagination has two bad options — re-rank per page (results shift under the user) or a server-side iterator (dies with the box). One expensive ranking pass into a session cache keyed by an opaque id, with the cursor as an offset, avoids both.

Hint 3

Followed boards are the only source that behaves like a social timeline. Fan out on write only below a follower threshold; mark celebrity boards as pull sources merged at read time. Recommendations dominate anyway, so the pull path stays small.

Asked at