Question bankPricingSign in

Design the Twitter Timeline and Search

Social MediaHard1:30

You are designing Twitter's core features: posting tweets, viewing a home timeline (tweets from people you follow), and searching tweets. The system has 100 million active users posting 500 million tweets per day. Each tweet must fan out to followers' timelines quickly. Explain your architecture, how the fan-out works for the home timeline, how you handle users with millions of followers differently, and your approach to tweet search.

How to approach it

  • Hint 1

    The home timeline is pre-computed: when a user tweets, it fans out to all followers' timeline caches. Think about the data structure in Redis for this.

  • Hint 2

    Celebrity accounts (millions of followers) break the fan-out model. Consider a hybrid approach.

  • Hint 3

    Search requires a reverse index -- think about how tweets are tokenized and indexed in near-real-time.

Ready to answer it out loud?

Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.

Practising needs an invite code. Join the waitlist and we’ll send you one.