mid System design
Design a URL shortener (TinyURL)
Design a service that takes a long URL and returns a short alias. Must support billions of redirects per day with low latency, predictable IDs, and analytics on click-through.
Scale targets
Users: 500M MAUQPS: 100k reads / 10k writesLatency: <50ms p99 redirectStorage: ~1TB / year of links
Key areas
Hash vs counter-based ID generationRead-heavy cachingAnalytics pipelineCustom alias collisionsAbuse + spam detection