Read tweets on homepage
Share tweets
Subscribe to a user's tweets and get notififcations
Post tweets
Favorite tweets and view them later.
High speed of homepage loading, slightly lower speed of posting a tweet.
Support peak times - celebrity tweeting.
Massive read traffic
Like/fav count doesnt have to be real time - prioritize visibility over stats.
Tweets must be durable
Its fine if a tweet reaches the follower's in a few seconds. no need for further optimization
Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
POST Tweet(content)
GET Tweet(tweetID) - this is used to view a specific tweet or get the share link
GET HomePage(user, contToken) - pagination used to load the user's homepage of trending tweets / follows
POST Like/Favorite tweet(tweetID)
DELETE Like/Favorite tweet(tweetID)
POST Follow(userId)
DELETE Follow(userId)
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.