Design Twitter

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2025-01-17

Problem Statement

🐦 Design Twitter


🧾 Design a microblogging platform like Twitter that allows users to post short messages, follow other users, and view a timeline of recent tweets.


Functional Requirements:

•Post tweets (max 280 characters).
•Follow/unfollow users.
•View timeline of tweets (most recent first). Like/retweet tweets.
•Support hashtags and search (optional).


Constraints:

•Billions of tweets served daily.
•High read QPS (timeline views) vs write QPS (tweets).
•Needs fanout strategy for feed generation (push vs pull).
•Availability > consistency in timeline delivery.

Solution

Comments