Design Twitter

hard
fan-out
caching
feeds
scaling

Problem brief

Twitter (X) lets users post short messages, follow other users, and see a home timeline made up of tweets from everyone they follow, roughly in reverse-chronological order. The read path — building that timeline fast for hundreds of millions of users — is the whole problem. It's a classic interview question precisely because the obvious answer ("query tweets from everyone I follow, sort, return") breaks down completely once follower counts and timeline-read volume are pushed to real scale.

Practice workspace

Guided practice or a locally saved 45-minute mock.

Step 1 of 8

Functional Requirements

What are the essential flows, and what would you explicitly leave out of version one?

Reference solution hidden

Try answering in the workspace above first. Reveal the full worked solution — data model, architecture, and trade-offs — whenever you want to compare.

Open the full solution page →