Loading...
GET /urls/?url=
Status code: 301 redirect
{
"redirected_url":
}
POST
/urls/
{
"url": "long format url",
"short_code":
"expiry":
}
return {
"url":
}
URL can be shotened using base 62 encoding
We can have bloom filter to check if the url exists or not for the given short code while creation
For expiry of urls, we can have postgresql extension installed to mark field as inactive when its ttl is crossed
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.