Practice: Design Twitter
Twitter/X architecture built progressively across 6 interview-scoped stages: tweet write path, follow graph, home-timeline fanout with hybrid celebrity handling, ranking/search (stretch goal), notifications/moderation, and monetization — kept deliberately lean (max 20 components) to match how a strong FAANG candidate would design and explain this system in 45 minutes.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Users can create tweets, delete tweets, and view tweet details.
- Users can follow or unfollow other users.
- Users can view a home timeline of tweets from followed accounts.
- Users can like, reply, repost/retweet, and quote-tweet posts.
- Users can search tweets by keyword, hashtag, and user.
- Users can receive notifications for engagement and relevant social events.
- The platform should support trending topics and basic recommendation/ranking features.
- The system should support ad or sponsored tweet insertion in timelines.
- The platform should support moderation workflows for spam, abuse, and policy violations.
Non-functional requirements
- Home timeline reads should remain low-latency under very high read-heavy traffic.
- Tweet-create write path should stay responsive even when fanout, indexing, or notifications are backlogged.
- The platform should degrade gracefully during downstream search, ranking, or notification failures.
- The design should support celebrity users, hot tweets, and bursty global events without collapsing caches or fanout systems.
- The system should provide strong observability for technical SLOs and product KPIs such as tweet impressions, timeline latency, and ranking quality.
- The platform should remain available during regional incidents with explicit RPO/RTO and safe rollout controls.