advanced practice · system design prompt
News feed (Twitter-style)
Design a home timeline feed: who you follow → posts you see, ranked recency-first. Compare fan-out-on-write vs fan-out-on-read. Address celebrity-follower asymmetry.
The mechanism
Feed systems pick between two strategies: precompute each follower's feed when you post (fan-out on write), or assemble it at request time (fan-out on read). The real-world answer is usually hybrid — fan-out-on-write fails for celebrities, fan-out-on-read fails for the long tail.
Expected evidence
Hybrid fan-out strategy + storage layout + a back-of-envelope read/write QPS estimate.
Try this drill in the practice workspace →
Hints when you need them
- Celebrities (>1M followers) break pure fan-out-on-write.
- A feed cache that is 80% pre-computed is usually enough.