InterviewForge

Design Twitter (Timeline & Feed)

A thorough design of Twitter: the tweet write path, timeline generation (fan-out vs pull), the celebrity problem, and Snowflake IDs for time-sortable tweets.

Updated 2026-09Medium

Requirements & scope

  • Functional: post a tweet, follow users, see a home timeline, see a user timeline, search.
  • Non-functional: timeline loads in <100ms, posts appear in seconds, the system handles celebrity fan-out.
  • Scale: ~300M users, ~500M tweets/day, read-heavy (timeline reads >> writes).
  • Consistency: timelines can be eventually consistent (a tweet may take a second to appear); ordering must be monotonic.

Out of scope (covered in detail below)

Trending topics, ads, live video, Spaces (audio), and lists — deferred and discussed in the dedicated section.

Unlock the full guide

Premium members get every DSA, system design, company and role interview guide — plus AI practice, mock interviews, and analytics.

Unlock with Premium