User should be able to compose and share the post
Post should appear in his timeline
The post should be published to the user's followers' timeline
Users should be able to express their likeness to the post
The solution should be scalable
High availability
Security
Let us consider that each post contains the following information:
> PostId: 4bytes = 2^32 range
> Content: 300 bytes = 300 char char length
@app.post("/post/tweet")
def post_tweet (request):
@app.get("/fetch/tweet")
def fetch_tweet():
@app.get("fetch/timeline")
def fetch_timeline(timeline_src: str = 'self'):
tweet_tabel{
tweet_id: str (32 chars)
tweet_content: str(300 chars)
tweet_time: Date
}
user: {
user_id: str ()
user_name: str,
user_location: str
}
user_followers: {
id: str(32)
user_follower: str(32)
user_follwed: str(32)
}
At a high level, I see the following components are applicable:
> Application server(which handles)
>
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...
Explain any trade offs you have made and why you made certain tech choices...
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?