I anticipate that this system will have about 1000 users per month. Each user will on average need to generate about 5 shortened urls per week, or roughly 20 urls per user, equaling 20000 requests for url shortening. Assuming most of the load will happen during business hours Mon-Fri, this comes out to about 1000 requests per day.
We'll start with the following endpoints:
tables:
flowchart TD A[Client] -->|HTTP Request| B[API] B -->|Route based on Endpoint| C{Request Type} C -->|POST| D[Shorten URL Logic] D --> E[Store URL in Database] E -->|Return Shortened URL| F[API Response] C -->|GET| G[Redirect to Original URL] G -->|Get Original URL| E
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?