Practice — Design a URL Shortener (bit.ly / TinyURL) (6 questions)
Intermediate
Open
Free
Estimating Traffic, Storage and Cache for a Shortener Permalink →
An interviewer gives you these assumptions for a URL shortener: 500 million new links per month, a 200:1 read/write ratio, links must be retained for 10 years, and each stored record averages 500 bytes.
- Compute average writes/s and reads/s, and a reasonable peak figure.
- Compute total storage after 10 years.
- Using the 80/20 rule, size a cache that holds the hottest 20% of URLs requested in one day. Is one Redis node enough?
Share this question
Intermediate
Open
Free
How Many URLs Fit in Six Characters Permalink →
Your URL shortener uses codes drawn from [a-z A-Z 0-9] — 62
characters.
How many unique URLs can a 6-character code hold, and at 1,000 new URLs per second, how long until the keyspace runs out?
Show the arithmetic, and say whether you'd launch with 6 or 7 characters.
Share this question