URL Shortener Design Patterns
Recurring patterns and approaches. Learn to recognize the pattern, understand the trade-offs, and apply the right solution.
Back-of-Envelope Estimation
Calculate QPS, storage, bandwidth, or cache size from given traffic numbers.
The question asks you to estimate numbers: 'How much storage?', 'What QPS?', 'How many servers?'
API Design
Define RESTful endpoints with request/response schemas.
The question asks 'Design the API' or 'What endpoints would you expose?'
Schema Design
Choose tables, columns, indexes, and database type for the system.
The question asks about 'database schema', 'data model', or 'what tables would you use?'
Trade-off Analysis
Compare two approaches and justify choosing one over the other.
The question presents options: 'Base62 vs MD5', '301 vs 302', 'SQL vs NoSQL'.
Scaling Bottleneck Identification
Identify what breaks first as traffic grows, and how to fix it.
The question asks 'How would you scale?', 'What happens at 1M QPS?', or 'Where is the bottleneck?'
Cache Strategy Selection
Choose the right caching pattern and eviction policy for the access pattern.
The question involves caching: 'How would you cache?', 'What cache invalidation strategy?'
Collision Handling
Handle the case where two inputs map to the same output.
The question mentions 'What if two URLs get the same short code?', 'How do you handle collisions?'
Monitoring and Alerting Design
Define metrics, dashboards, and alerts for production health.
The question asks 'How would you monitor?', 'What metrics would you track?', 'How do you know if something is wrong?'