Define the APIs expected from the system. This is your chance to analyze and define the read and write paths so that you can come up with the high-level design...
Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.
When the client sends a request for a first time fetching of shortened url, it is sent to cdn for faster access, if its a request for new shortened url, its sent to load balancer
if cdn has the original url, it returns or else its sent to load balancer
now the load balancer uses a round robin to select a server for the task(new shortened url), but if its just fetching, it goes on directly to db server to fetch original url and return it to client
server 1 and server 2 can fetch data and return but load balancer does the task for now, but if its for creating a new url, they can handle
db server is used to shard data around a n databases, so that fetching can be faster
server 1 and server 2 can be used to add analytics and other kind of dashboard services (there can be n servers)
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
For low latency and faster acces we use cdn, even though if cdn doesnt have it, it increases response time, but for new users then, the response time will be low (we are using pull for cdn)
load balancer helps to handle multiple users at a time
db server helps to reduce data lookup time
multiple servers balance the load and reduce response time