For now, we will assume a user system is created for us, and we will focus more on the "tweet" side of the system. We can come back to this if we want to dive deeper into it.
User Actions
For this, I think a RDB for the core DB is a good choice, since the system has a lot of intertwining relationships.
We will likely have a caching layer on top of this that we will dive more into in the design section.
User
Tweet
Follows (user -> following)
Likes
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
User Service
Tweet Service
News Feed Service
Message Queue
Things we'll have, but will focus less on for the purpose of this interview:
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Create
Like
Follow
Databases are synced across regions, and the feeds are updated asynchronously.
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Tradeoff
Try to discuss as many failure scenarios/bottlenecks as possible.
What if the news feed cache fails
What if the message queue fails
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?
We should handle large spikes in usage, for example if a popular creator adds a tweet that suddenly gets many thousands of likes.