Ability to take the url and return a shorter version of the url
Estimate the scale of the system you are going to design...
So we can have two API's , First one would be to create a GET Request which can have url like below:-
co.me/url-short-link
The API , can have 200 success status code and 404 if something went wrong
We may also want to ensure that API are encoded and malicious content request should be denied.
For DB we can have a no-sql DB that will not have scalability issues. Can store in key value pair fashion.
We are going to have a design in which the API would call the load balancer which would redirect it to API gateway from there request would come to the application server.
The application server will check if the request is present in the in-memory cache else we can make a call to DB to get the
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?