Design a URL Shortener (like Bitly)
AI Interviewer Insight
A URL shortener requires understanding of database scaling, hashing algorithms (like Base62 encoding), and caching. You need to discuss high availability, low latency redirection, and how to handle collisions in hash generation.
Strong Answer
"I would start by defining the scale: 100M new URLs per month, heavily read-heavy (100:1). I'd use a NoSQL database or a Sharded SQL database. For the short URL generation, I'd use a Key Generation Service (KGS) that pre-generates unique Base62 strings to avoid collisions."
Poor Answer
"I would just use a MySQL auto-increment ID and convert it to string."
Common Pitfalls
- •Not asking for scale requirements first
- •Using MD5 hashing without handling collisions
- •Ignoring analytics and metrics tracking requirements
Likely Follow-Up Questions
How would you cache the popular redirects?
What happens if the Key Generation Service goes down?
Practice this question
Speak your answer out loud and get instant AI feedback on your delivery, pacing, and content.
Start Voice Mock Interview