System Design 1 / 13
Design a URL Shortener
Example answer and explanationLink to this question
Clarify link creation, redirects, expiration and analytics. Store a unique short code → destination mapping with a uniqueness constraint and a collision retry policy. Cache frequently used mappings for read-heavy traffic; redirect only to validated destinations. Send click events asynchronously so analytics does not delay redirects. Discuss code generation, cache invalidation, abuse prevention and the consistency needed when a link is deleted.
Study the topic: URL Shortener →