User should be able to submit URL
User should be able to get original URL
User should be able to give alias to a given URL
No 2 URL should point to same shortend URL
User should be able to delete the alias
Strong Consistentency is needed when it comes to generating shortend URL
The system should be able to handle 100 million request in a given day
POST /generateShortURL
header: JWT | Session
{
"originalURL" : "example.com"
}
response 301: {
"shortendURL" : "example.com",
"originalURL" : "originalURL.com"
}
GET /generateShortURL?q=originalURL="originalURL"
response 301: {
"shortendURL" : "example.com",
"originalURL" : "originalURL.com"
}
GET /generateShortURL?q=shortendURL="example.com"
response 301: {
"shortendURL" : "example.com",
"originalURL" : "originalURL.com"
}
POST /generateShortURL
header: JWT | Session
{
"originalURL" : "example.com",
"alias" : "UniqueAlias"
}
response: {
"shortendURL" : "example.com",
"originalURL" : "originalURL.com"
}
DELETE /generateShortURL/Alias
response: 204
URLTable
USERTable
..
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...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?