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...
1) POST API to generate a short URL from the given long URL
2) GET api to return the formed long url from shorter one
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.
user hit's the server, if present in cache give the longer url, else check DB
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.
1) user's long url is converted to shorter one using an algorithm (auto-increment id, encoding)
2) the short URLs are stored in DB as a map of short-url -> long-url. We can also store the timestamp, click_count. We will use relational DB
3) Use a redis cache, where we will store hot URLs