We will have some algorithm figuring out which posts have the highest engagement hourly and pull that into the cache for users to to pull into their own feed. Their feed will also have cached a list of who they follow indexed on uid for our followers table. That way we can quickly figure out who they follow and pull latest posts from them.
Another thing we can do is for popular users with many followers we can cache their posts as well to fan out to users since they have a large amount of followers these posts being cached will save us a lot of time for when their followers log on and pull posts.
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...
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...
Main trade off we have is for fast reads vs writes, since most of of our users will be reading tweets rather than creating them. Its fine if the tweet isn't shown to everyone right after they post.
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?