Design a news feed like Facebook's
hard 50 minShow each person the best recent posts from everyone they follow, in a fifth of a second.
What each level should show
The same question is judged differently for mid, senior and staff.
Mid
Must show
- A working post and feed, end to end
- Push and pull explained
- A cache with IDs
- Cursor instead of offset
Will be probed on
- What if the author has a million followers
- Deleting a post
- Why asynchronous
Stands out
Compares push and pull with two numbers.
Senior
Must show
- Hybrid fan-out with a reason for the limit
- Hydration and its load
- Read-time permission checks
- Fallback for ranking and cache loss
Will be probed on
- Repeated or lost tasks
- Stable order with ranking
- Rebuild storms
Stands out
Finds the 20x lookups before being asked.
Staff
Must show
- Names the crux in minutes
- Cost of ready feeds and how to cut it
- Regions and user homes
- Safety, abuse and measuring quality
Will be probed on
- Moving the limit on live traffic
- Ranking rollout
- Permission freshness across regions
Stands out
Turns freshness into a price and lets the product choose.
Same question, three answers
"How does a post reach my feed?"
| Level | A good answer sounds like |
|---|---|
| Mid | "It is stored, a worker adds its ID to each follower's list in Redis, and my feed reads that list. Famous people are fetched when I open it." |
| Senior | "Durable first, then an event from the change stream. Workers push to warm feeds under 10,000 followers. Larger accounts sit in feed server memory, 2 GB in all. I drop duplicates and check audience at read." |
| Staff | "The boundary is cost: push while followers times posts is cheaper than the reads saved. I would choose by pair, author and reader, if the data shows many followers never open the app. The check at read lets me change paths safely." |