advancedTop 15 System Design Questions
Design a URL shortener (bit.ly) that handles 100K redirects/second.
ID generation: Redis INCR + base62 encoding (or distributed ID like Snowflake) Write path: store {shortCode → longUrl} in MongoDB + Redis cache Read path: GET url:{code} from Redis (< 1ms); miss → MongoDB → cache Redis cluster: 3 masters × 100K ops/s each = 300K ops/s capacity MongoDB: partitioned by shortCode for durability Analytics: INCR clicks:{code} in Redis; batch flush to MongoDB hourly Cus
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response