Loading...
POST: /create-url
GET: /{short-url}
How long should the url be?
What is the scale of the application?
Example 1,000 URLs generated per second
1000 * 60 (seconds in an minute) * 60(minutes in an hour) * 24(hours a day) * 365 (days in a year)
10 to 1 read to write requests means 200 billion reads per year
What characters can we use?
a -z = 26
A - Z = 26
0 - 9 = 10
Total 62 characters
How many unique short urls can be created?
1^62 = 62. (1 character)
2 ^62 = 3, 844 (2 characters)
...
6 ^ 62 = 56 billion (6 characters)
7^62 = 3.5 trillion (7 characters)
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.