Functional: a user follows other users; posting a photo shows it in followers' feeds; the feed is reverse-chronological (or ranked — start with chronological, ranking is a follow-up).
Non-functional: feed loads must be fast (users check it constantly); the system must handle users with huge follower counts (celebrities) without falling over.
The core tension: fan-out on write vs. fan-out on read
This is the single most important design decision in this problem, and interviewers expect you to discuss the tradeoff explicitly, not just pick one.
Fan-out on write (push): when a user posts, immediately insert that post into every follower's precomputed feed. Reading a feed is then just one fast lookup. But a celebrity with 50M followers triggers 50M writes for a single post — a "thundering herd" write.
Fan-out on read (pull): store posts once; when a user opens their feed, query all the people they follow and merge results on the fly. No write amplification, but reading becomes expensive — especially for a user who follows thousands of accounts.
The real answer used in production (a hybrid): fan-out on write for normal users (most people have a few hundred followers, so the write cost is small and reads stay fast), fan-out on read for celebrity accounts specifically (their posts are merged into a follower's feed at read-time instead of pushed).
Architecture (hybrid approach)
Step 1 / 5
A user publishes a new post.
Follow-ups interviewers often ask
How would you rank the feed instead of showing it chronologically? (A separate ranking service scores candidate posts by engagement prediction; the feed cache stores candidates, ranking happens at read time — keeps the fan-out logic unchanged.)
How do you avoid showing a deleted post that's still sitting in precomputed feed caches? (Store a post ID + a lightweight existence check, or a TTL/invalidation event that removes it from caches on delete.)
Not practiced yet
Practice this live with an AI interviewer
Starts a System Design mock interview pre-filled with this problem — you can edit the brief before starting.