Design Twitter's Home Timeline
Design the home timeline for a Twitter/X-style social network.
Functional:
- Users follow and unfollow other accounts.
- Users publish short text posts, optionally with one attached image.
- Users open a home timeline of recent posts from the accounts they follow, newest first, paginated.
- A post from a normal account should reach its followers' timelines within a few seconds.
Non-functional:
- Timeline read latency p99 under 200 ms server side.
- 99.95 percent availability on the read path. A slightly stale timeline beats an error.
- Ordering is strictly reverse chronological. There is no ranking model yet.
- 300M registered accounts, 150M daily actives.
- 45M posts per day, about 520 writes/sec average and 1.6k/sec at peak.
- 1.2B timeline reads per day, about 14k reads/sec average and 40k/sec at peak.
- The median account follows 200 others. The largest accounts are followed by 10M to 100M people.
- Text payload averages 300 bytes. Roughly 10 percent of posts carry a 500 KB image.
- Growth of about 8 TB per year in post rows and 800 TB per year in media.
Direct messages, notifications, search, trending topics, ads, moderation tooling, and ML ranking.
Loading editor...
Submit your design to grade it.
- The components and connections this prompt needs
- Structure: an entry point, data stores, async work, and failure handling
- The concepts you explain on the board or in Notes, in your own words
To pass, score 65 or more with every required component but one, and name at least half the concepts, or all of them if a component is missing.