You are building a URL shortening service similar to Bit.ly that will handle 10 million users. Users submit a long URL and receive a shortened link. When anyone visits the short link, they are redirected to the original URL. In your answer, explain the high-level architecture, how you would generate unique short URLs, your database choice, and how you would handle the 10:1 read-to-write ratio at scale.
How to approach it
- Hint 1
Think about how to generate a unique 7-character short code -- hashing vs. pre-generated keys.
- Hint 2
Consider the read-to-write ratio: reads are 10x more frequent than writes. Where does caching fit?
- Hint 3
Back-of-envelope: 10 million pastes/month at ~1 KB each is only ~10 GB/month of storage.
Ready to answer it out loud?
Record your answer in 1:30 and Preptile scores it 1–10 with specifics — what landed, what you skipped, and what to say next time.
Practising needs an invite code. Join the waitlist and we’ll send you one.