Requirements


Functional Requirements:


  • Create a short URL for a given long URL.
  • Return the long URL associated with a given short URL.



Non-Functional Requirements:


    List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...


API Design

we are going to design two differnt apis

client create a short url from the long url so client will send the long url from the short url itself


POST

end point /data/short

body : long url

return :short url


If client need to get the Short url only

end point /data/getshort

body: shortURL

return longUrl





High-Level Design

1) As url enter the shortUrl the api end point redirect the to long url using the 301 status code


Detailed Component Design

Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.