1) System must be able to generate short url from url provided by user
2) System must be able to receive shortened url from user and redirect to related lon url
3) Link should be
Focus on consistancy and availabiity
Estimate the scale of the system you are going to design...
Defining the system data model early on will clarify how data will flow among different components of the system. Also you could draw an ER diagram using the diagramming tool to enhance your design...
flowchart TD A[User] -->|Sends long URL| B[Load Balancer] B -->|Distributes requests| C[URL Shortener Service Instance 1] B -->|Distributes requests| D[URL Shortener Service Instance 2] B -->|Distributes requests| E[URL Shortener Service Instance 3] C -->|Generates unique alias| F[Database] D -->|Generates unique alias| F E -->|Generates unique alias| F F -->|Stores mapping| G[Store Shortened URL] A -->|Accesses Shortened URL| B B -->|Directs to service| C B -->|Directs to service| D B -->|Directs to service| E C -->|Checks Cache| H[Cache] D -->|Checks Cache| H E -->|Checks Cache| H C -->|Retrieves long URL| F D -->|Retrieves long URL| F E -->|Retrieves long URL| F F -->|Redirects to long URL| A
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?