http://servicehost.com/shortened_alias, allowing browsers to correctly route requests to your service.Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
at least 2 apis. one get request to read the long url and generate new persist into database and send new short as response. second get request to get short url to look up into database to get long url then redirect to it.
api server run on k8s to make horizontally scale automatically. redis for data quick fetch. new record comes directly into redis and sync into database later. db uses postgresql for large volumn and quick reaction and low cost.
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.