-the user should be able to send a url, and get a short version of it
-everytime someone use the shrot version of the url, it will be rout to the long url
the main data will be list a hashmap from the shorter to the original url
I could also save some extra data like the lastTimeUsed, so I can remove when it wasnt used for a ling time. I dont think I care how create it, or when it was created, I dont care how access it, just care to know that it is been used or no, so if is not been use I could delete it to save space...
I dont know if that is something that its happens, but I think I can say if a url is not used by anyone for 1 year, I think that url is no valid anymore...
I will have many urls, as we said, every day will have 5million new urls, so I think I should use a noSQL database, like mongodb to store the urls.
the object will have this structure:
{
originalUrl: string
shortUrl: string
lastTimeUsed: datetime (will be updated when created, and everytime its requested)
}
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...
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?