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...
createLink(longUrl: string) -> (shortUrl, err)
getLongUrl(shortUrl: string)-> (longUrl, err)
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.
this is going to be a very read heavy service. Although don't expect the number of writes to be high. we will use an in memory cache, holding onto most recently used key value pairs for short -> long urls
if a client requests a url not in cache server will write to cache first and the response will be made directly from cache
db schema:
uuid(be able to have unique short->long urls)
shortLink
longLink
createdAt
lastAccessed(identify what to push off LRU cache)
user_uuid (so that users can delete their own links when they want to invalidate)
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.