500k total shorten requests per month
30M URL mappings in storage
assume average 60 bytes per mapping
1.8GB total storage needed
"Shorten URL"
POST /v1/urls/shorten
params: {
long_url
token
custom_expiration_duration
custom_category
}
returns: {
short_url
}
"Get URL info"
GET /v1/urls/info
params: {
url (short or long)
is_long_url: bool
token
}
returns: {
short_url
long_url
expiration_date
category
}
"Redirect"
returns a redirect code and the long URL in the header. Don't allow client caching of redirection so we can capture all clicks for analytics.
"Update URL info"
Allow user to specify new expiration date and category.
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...