Design a URL-shortening service (e.g., Bitly). Outline the API, data model, and scalability considerations.
Sigiloso
I proposed using a key-value store (e.g., DynamoDB) to map short codes to long URLs, with Base62-encoded IDs generated by a centralized service to guarantee uniqueness. I suggested read-heavy caching via Redis, eventual consistency for analytics, and sharding or consistent hashing to avoid hot partitions. For high availability, I recommended multiple replicas behind a load balancer and an async queue to capture click metrics without blocking redirects.