Pattern 01 · Fan-out & Feeds · Staff-Level Simulation

Design Twitter like the timeline is already materializing.

A feed is a question with three answers: do you build each follower’s timeline when the author posts (push), when the reader opens the app (pull), or both (hybrid)? The entire interview pivots on that single decision and on the one input that breaks the naive answer: the celebrity with a hundred million followers. This playbook scripts the loop end to end for the most-asked question in the canon.

Time Budget · how the 45 min should split

45:00total  /  you must drive every minute
Scope
~6m
API
~5m
HLD
~13m
Deep dives
~15m
Wrap
~6m

The shape of the problem

post push: fan-out on write VIP pull at read
AllowSay this — it earns the signal interviewers grade.
ThrottleDefensible, but only with a stated reason.
RejectNever say it. Each one is a downlevel flag.
01 How you're actually graded

Six buckets — and judgment outweighs the diagram.

Every FAANG company runs a rubric. The dimensions are roughly the same; the weights differ by company and level. At senior+ the boxes-and-arrows are table stakes — what gets graded hardest is the quality of your decisions: the questions you asked first, the trade-offs you surfaced and defended, and the production reality you volunteered without being asked.

DimensionWeightWhat earns the signal
Requirements & scoping10–15%You scoped before drawing, asked enough to bound the problem, pinned the scale number, and stated assumptions out loud.
High-level architecture20–25%The right components, a clear data flow, and a reason every box exists. The design satisfies each functional requirement.
Technical depth / deep dives~30%You go three questions deep on the hard part without being rescued. This is where staff is won or lost.
Trade-offs & judgmenthighest effectiveTwo viable options, what each costs, and a committed pick for this system. Simplicity over flash when flash isn't warranted.
Communication / drivingcross-cuttingYou drive the 45 minutes; the interviewer never has to rescue you. You narrate, checkpoint, and narrow when the design sprawls.
Operational maturity↑ in 2026The newest weight: observability, rollout, failure modes, on-call reality — volunteered, not pried out.
!
The 2026 shift, in one line. Operational concerns are now a first-class graded dimension, and "it depends" without a committed answer reads as evasion rather than nuance. Name the trade-off, then pick.
02 The same answer is scored differently at each level

It's a sliding scale, not a pass/fail bar.

A solid design with reasonable trade-offs is a strong score for a mid-level candidate and a downlevel flag for staff. The questions can be identical; the depth expectation is not. As you climb, the balance tips from breadth toward depth, proactivity, and production reality.

Mid-level
Meta E4 · Google L4 · Amazon SDE-II
80
20
breadthdepth
  • Crafts a high-level design meeting the functional requirements; explains one approach (usually pull) cleanly.
  • Identifies the home-timeline cache and that posts and the social graph need separate stores.
  • When prompted about celebrities, recognizes pure push breaks — with some guidance reaches for a hybrid.
  • Interviewer confirms understanding of each component; not expected to spot every flaw alone.
Senior
Meta E5 · Google L5 · Amazon SDE-III
60
40
breadthdepth
  • Moves fast to the push/pull/hybrid decision and commits to hybrid with the celebrity reasoning unprompted.
  • Talks read:write asymmetry, materialized feeds in Redis, async fan-out workers behind Kafka.
  • Caps feed size, TTLs inactive users, and handles cursor-based pagination on a changing feed without a hint.
  • Has an opinion on chronological vs ranked and what a ranking layer adds.
Staff+
Meta E6 · Google L6 · Amazon Principal
40
60
breadthdepth
  • Establishes fundamentals fast, then spends most time on the ranking pipeline, hot keys, and multi-region.
  • Strong experience-backed take on feature stores and online scoring latency budgets.
  • Treats fan-out lag SLOs, feed-staleness dashboards, and gradual rollout of a ranking change as routine.
  • Frames decisions in terms of write-amplification cost and cross-team impact (the ranking team, the graph team).
03 The lens senior engineers narrate through

Borrow AWS's Well-Architected pillars as your trade-off vocabulary.

You don't recite AWS — you anchor each decision to one of these. It signals you evaluate systems across competing concerns rather than optimizing one axis. Each pillar below is mapped to a move you can make in this exact design.

PILLAR 01

Operational Excellence

Run and observe the fan-out pipeline.

Hook: “I’d track fan-out lag p99 — time from post to appearing in follower feeds — and alert when it exceeds a few seconds.”
PILLAR 02

Security

Protect the graph and abuse surface.

Hook: “Follower lists are PII-adjacent; rate-limit follows and scope who can fan out to whom to blunt spam amplification.”
PILLAR 03

Reliability

Survive the celebrity spike.

Hook: “Fan-out workers are idempotent and replayable from Kafka, so a worker crash mid-fan-out just resumes without double-posting.”
PILLAR 04

Performance Efficiency

Keep the read path cheap.

Hook: “The home timeline read is the hot path at ~100:1 reads:writes, so it must be a single cache lookup, not a scatter-gather.”
PILLAR 05

Cost Optimization

Don’t materialize what nobody reads.

Hook: “Pull for inactive users instead of precomputing feeds they’ll never open keeps the Redis footprint bounded.”
PILLAR 06

Sustainability

Bound the working set.

Hook: “Capping each cached feed to ~800 entries and expiring dormant feeds keeps memory — and cost — from growing with total users.”
!
How to use it without sounding like a checklist. Don't list the pillars. Weave one in when you commit: name a trade-off, name the pillar it serves, and make the call. One sentence that does all three reads as senior.
03·5 The architecture you draw on the whiteboard

The hybrid feed, end to end — one picture to redraw from memory.

This is the high-level design the interviewer wants on the board by minute 20. Two paths share one cache: a write path that fans ordinary authors out to their followers' materialized timelines, and a read path that serves those timelines in a single lookup — then merges in the handful of celebrity posts that were deliberately not fanned out. Trace the arrows out loud as you draw them and the whole design narrates itself.

⚡ Celebrities skip fan-out — pulled & merged at read time WRITE PATH · PUSH READ PATH · HYBRID Authorposts a tweet API / LBwrite Fan-out Servicepush vs pull decision Kafkafan-out queue Fan-out Workersidempotent Redisper-usertimelines Posts DBCassandra · source of truth ordinary followers store tweet Readeropens home feed API / LBread Timeline Servicemerge & rank read materialized feed pull recent (celebrities) merged home timeline
Write path (push) Read path Hybrid pull (celebrities)
The one-cache hybrid. Ordinary authors fan out through Kafka into per-follower Redis timelines (fast reads, bounded writes). Celebrities are never fanned out — the Timeline Service pulls their recent posts from the Posts DB and merges them at read time. Say it out loud: “push for the many, pull for the few, merge at read.”

How to narrate it in the room

04 The interview, minute by minute

Five phases. Drive every one of them.

The simulation. Framing throughout: a Twitter-scale feed — ~300M DAU, ~500M posts/day, a read-heavy workload around 100:1, home-timeline reads targeting p99 < 200ms, eventual consistency acceptable.

01Requirements & Scoping~6 min · don't draw yet
Grading this window: Can you bound the problem and surface the read:write asymmetry that dictates the whole design? Naming celebrities and ranking-vs-chronological in scoping is a senior tell.

Split the write path (posting) from the read path (viewing the home timeline) immediately — they have wildly different volumes and that gap is the heart of the problem.

Functional requirements to land

  • Post a tweet (text first; media is a sub-problem you can defer).
  • Follow / unfollow users — the social graph.
  • View the home timeline: a merged feed of the people you follow, newest-first (or ranked).

Non-functional requirements to land

  • Read-heavy: reads dominate writes by ~100:1 — optimize the read path above all.
  • Low read latency: home timeline p99 < 200ms.
  • Eventual consistency: a tweet appearing a few seconds late is fine; trade consistency for availability.
  • Scale: ~300M DAU. Confirm the number; don’t assume.
▲ Allow — say this

“Before I design — is this chronological or ranked? And do we have celebrity accounts with tens of millions of followers? Those two answers change the architecture more than the scale number does.”

▲ Allow — say this

“This is read-heavy by roughly 100:1, so I’ll optimize the read path even at the cost of doing more work on write. That single asymmetry is what pushes us toward precomputing feeds.”

▼ Reject — never say this

“Let me start drawing.” Jumping to boxes before naming the read:write ratio means you’ll design the wrong path well.

Scripted exchange
Interviewer

Design Twitter.

You

Let me scope. Core actions: post, follow, and read a home timeline. The defining feature is that reads vastly outnumber writes, so I’ll optimize reads. Two questions that’ll shape everything: chronological or ranked, and do we have celebrity-scale accounts?

Interviewer

Chronological for now. Yes, celebrities exist.

You

Then the celebrity case is my central design constraint, and I already know pure push won’t survive it. Let me build the simple version first and evolve into a hybrid.

02Entities, API & Estimation~5 min
Grading this window: Clean domain model and a back-of-envelope that makes the fan-out cost visible — that number is your bridge into the deep dive.

Three entities: User, Tweet (id, authorId, body, ts), and the Follow graph (follower → followee edges). Two endpoints carry the product:

postTweet(authorId, body) tweetId getHomeTimeline(userId, cursor) { tweets[], nextCursor }

The estimate that matters

Fan-out cost = average followers × posts/sec. If the average user has a few hundred followers, each post is a few hundred feed writes — cheap. But a celebrity with 100M followers turns one post into 100M writes. State that asymmetry out loud: it’s the entire justification for going hybrid.

▲ Allow — say this

“Pagination uses an opaque cursor keyed on tweet ID, not an offset — the feed changes under the reader, and offsets would skip or repeat tweets as new ones arrive.”

▼ Reject — never say this

Designing a heavy normalized SQL schema for tweets. The interesting data here is the feed and the graph, not a third-normal-form tweet table.

03High-Level Design (the MVP)~13 min
Grading this window: Build the naive version, show it works, then expose its cost. The right components with a justified data flow.

Start with the simplest thing that satisfies the requirements, then let its weakness pull you forward.

The naive pull design

Store tweets in a tweet store; store the follow graph. On getHomeTimeline, look up everyone the user follows, fetch their recent tweets, merge-sort by time, return the top N. It works — and it’s a great starting point because you can immediately name why it doesn’t scale: a user following 5,000 accounts triggers a 5,000-way scatter-gather on every single feed open. On the hottest path. At 100:1 reads.

Evolve to push (fan-out on write)

Flip the work to write time. Maintain a materialized home timeline per user in Redis (a capped list of tweet IDs). When someone posts, asynchronous fan-out workers (fed by Kafka) append that tweet ID to each follower’s cached feed. Reads become a single cache lookup — exactly what the hot path needs.

store: tweets → Cassandra (write-heavy, by tweetId) graph → follower edges (sharded) feeds → Redis list per user (capped ~800) flow: post → Kafka → fan-out workers → append to each follower feed
!
The trap door the interviewer opens here. “What happens when a celebrity with 100M followers posts?” Pure push means 100M feed writes for one tweet — a write storm that delays every fan-out behind it. Reaching for the hybrid before being asked is the senior signal.
▲ Allow — say this

“I’ll precompute feeds on write for normal accounts so reads are one lookup. But I’ll cap fan-out: above a follower threshold, an account is ‘pull’ — we don’t fan their posts out, we merge them at read time.”

◆ Throttle — only with a reason

Pure pull “because writes stay cheap.” Defensible only if reads are rare or feeds tiny — say so. For a read-heavy social feed it’s the wrong default; name why before dismissing it.

▼ Reject — never say this

“We’ll just fan out every post to every follower.” Without the celebrity carve-out this collapses the moment the interviewer names a popular account.

04Deep Dives — the stress test~15 min · where staff is decided
Grading this window: Lead toward the deep dives that satisfy your non-functional requirements. At staff you volunteer these. The hybrid, the celebrity merge, and ranking are 30%+ of the score.

The hybrid, precisely

Classify accounts by follower count. Below the threshold: fan out on write into follower feeds (fast reads). Above it (celebrities): do not fan out; store their recent posts separately. On read, take the user’s materialized feed and merge in the latest posts from the handful of celebrities they follow, sorted by time. This bounds write amplification without making the common-case read a scatter-gather. The cost: read becomes “cache + a few small fetches” instead of one lookup — a deliberate, defensible trade.

Feed cache management

  • Cap each feed to the most recent ~800 IDs; older history is regenerated from the tweet store on demand.
  • TTL dormant users’ feeds and rebuild lazily on next login — don’t pay to maintain feeds nobody reads.
  • Hot keys: a viral tweet read by millions is a read hot key — cache the tweet object behind a CDN/edge layer, separate from feed storage.

Ranked feeds (when it’s not chronological)

Ranking turns the merged list into candidates. Add a feature store and an online scoring layer: generate candidates (followed + some recommended), score thousands of them in a few milliseconds against precomputed features, return the top slice. Precompute heavy features offline; keep the online path lean to hold the latency budget.

▲ Allow — say this (staff move)

“The write-amplification math is the whole game: hybrid trades a slightly more expensive read for a bounded write. I’d roll a ranking change out as a canary on a small traffic slice, watching engagement and p99 before widening — a bad ranker degrades the product silently.”

▼ Reject — never say this

“We’ll add more Redis.” Capacity without the hybrid carve-out doesn’t fix the celebrity write storm — it just spreads it.

Scripted stress-test exchange
Interviewer

A celebrity with 100M followers tweets. Trace it.

You

That account is above my fan-out threshold, so the post is not fanned out — it’s written once to a celebrity-posts store. No write storm. Their followers pick it up at read time: when any of them opens their timeline, I merge that celebrity’s recent posts into their materialized feed before returning.

Interviewer

Doesn’t that make reads slower for everyone?

You

Only by the cost of merging a handful of celebrity posts — most users follow very few mega-accounts. I’m trading a small, bounded read cost for eliminating an unbounded write cost. If a user somehow followed thousands of celebrities I’d cache the merged result briefly, but that’s a rare tail.

05Wrap-up — operability & recap~6 min
Grading this window: Prove you could run it. Volunteer observability and rollout; recap the trade-offs; name what you deferred.

Observability — volunteer it

  • Fan-out lag p99: time from post to appearance in follower feeds — the core SLO.
  • Feed cache hit rate and Redis memory per shard.
  • Read p99 for the home timeline against the 200ms budget.
  • For ranked feeds: engagement metrics behind every ranking change, watched per canary.

Rollout

Threshold changes (who counts as a celebrity) and ranking changes go out as canaries with a fast rollback. Keep the chronological path as a fallback if the ranker misbehaves.

▲ Allow — say this

“With more time I’d dig into media storage and the recommendation/candidate-generation side. I scoped those out deliberately — I didn’t miss them.”

05 The follow-up gauntlet

The probes you'll get — and the answer that holds.

Interviewers rarely accept the first answer — they push to find the edge of your fan-out reasoning. Answer the question asked, give the reasoning, then stop.

"Push, pull, or hybrid — and why?"

All three are valid for different shapes. Push gives O(1) reads but unbounded writes on popular accounts. Pull gives cheap writes but expensive scatter-gather reads. For a read-heavy social feed with celebrities, hybrid wins: push for normal accounts, pull-and-merge for the few mega-accounts. I commit to hybrid and name the celebrity threshold as the dividing line.

"How do you keep the home-timeline cache from growing forever?"

Cap each feed to ~800 recent tweet IDs; older history regenerates from the tweet store on demand. TTL dormant users and rebuild lazily on next login. That bounds memory to active users × cap, independent of total user count.

"Chronological vs ranked — how does ranking change the design?"

Ranking turns the merged feed into a candidate set scored by an ML layer. I add a feature store and an online scorer that ranks thousands of candidates in a few ms using precomputed features. The fan-out machinery stays; I just insert a scoring step on read and broaden candidates beyond strict follows.

"How do you paginate a feed that's changing under the reader?"

Cursor-based, keyed on tweet ID or a snapshot timestamp — never offset. An offset would skip or duplicate tweets as new ones arrive at the head. The cursor anchors the reader to a stable point in the timeline.

"A user follows 5,000 accounts and pull is slow. Fix it?"

That's exactly why normal accounts are push: their tweets are already in this user's materialized feed, so following 5,000 normal accounts costs nothing extra at read time. Only the celebrity subset is merged on read, and that set is small. Pull-everything is the design I rejected for this reason.

"How fresh must the feed be?"

Eventually consistent — seconds of lag is invisible to users and lets me make fan-out asynchronous and the system highly available. I'd never trade availability or read latency for making a tweet appear a few hundred milliseconds sooner.

!
Handling a probe you can’t fully answer: don’t bluff. “I haven’t tuned the exact celebrity threshold at this scale, but the knobs are follower count and the read-merge cost it imposes — here’s how I’d measure where to set it.” Honest reasoning under uncertainty reads as more senior than false confidence.
06 What gets you downleveled

The flags that quietly tank an otherwise solid loop.

A clean design with one of these undercurrents still scores below the bar at senior+. None are about getting an answer wrong — they're about how you operate.

Drawing before scoping

Jumping to architecture without bounding the problem or confirming scale. Reads as template-matching.

Hedging without committing

"It depends" with no decision behind it. Name the trade-off, then pick.

Needing rescue on the hard part

Stalling at the core deep dive until the interviewer feeds you the answer. Depth is the senior+ bar.

Pure push with no celebrity plan

Committing to fan-out-on-write without naming the write storm a popular account creates. The interviewer is waiting for the carve-out.

Offset pagination on a live feed

Reveals you haven't thought about a feed that mutates at the head while the user scrolls.

Skipping operations entirely

No observability, no rollout, no failure-mode plan. In 2026 this reads as "has never carried a pager."

Bluffing under a probe

Confident wrong answers when pushed. Far worse than an honest "here's what I'd verify."

Not driving

Waiting to be asked the next question. At staff you own the 45 minutes.

07 Your pre-loop scorecard

Self-grade before you walk in.

Run a mock and score yourself honestly against the dimensions the interviewer uses. If you can't hit "strong" on depth and operability, that's your signal on where to drill.

DimensionWeak (downlevel)Strong (at level)
ScopingStarted drawing; missed the read:write ratio.Named ~100:1 reads, asked chronological-vs-ranked and celebrities up front.
Fan-out choicePicked push or pull with no trade-off.Committed to hybrid with the celebrity threshold and the write-amplification reasoning.
Celebrity handlingNeeded a hint; had no plan.Raised it unprompted; pull-and-merge for mega-accounts, push for the rest.
Feed cacheUnbounded cache; never mentioned eviction.Capped feeds, TTL'd dormant users, separated viral-tweet read hot keys.
Ranking awarenessDidn't know what ranked adds.Described feature store + online scoring over candidates within the latency budget.
OperabilityNever mentioned it.Volunteered fan-out-lag SLO, cache-hit dashboards, canary rollout of ranking.
The 60-second recap that lands the level
Quick recap: read-heavy by ~100:1, so optimize reads; materialized home-timeline feeds in Redis via async Kafka fan-out workers; hybrid — push for normal accounts, pull-and-merge for celebrities to bound write amplification; capped feeds with TTL; a feature-store + online scorer if ranked; and full observability with canary rollout. With more time: media storage and candidate generation.
The one mental model: a feed is a choice about when you pay — at write time or read time. Push pays on write, pull pays on read, hybrid splits the bill so neither side goes bankrupt on the celebrity case. Say “this is fundamentally a fan-out problem” in the first two minutes and the rest of the hour reads as someone who’s seen the family before.