Track 1 · Core
URL Shortener
Billions of unique codes, redirects at scale, and a disabled link that actually stops.
Free Easy 11 min guided 6 Checks
What you practice
This is where most people start: a small system with one sharp edge. You will hand out codes that never collide, keep redirects fast with a cache, and still make a disabled link stop on time.
The problem
Design a service that turns a long URL into a short one and sends anyone who opens the short link to the original.
The map from code to URL is trivial. The hard parts are handing out billions of codes without ever overwriting one, and keeping redirects fast while a link that was just disabled stops working when you said it would, not "whenever the cache expires".
A person creates a short link, optionally with an expiry. Anyone can open it and gets redirected. The owner, or moderation, can disable a link. Clicks are counted, without promising an exact count. Redirects must be fast and highly available; analytics may lag by minutes.