Design a URL Shortener

easy
hashing
databases
caching
scaling

Problem brief

A URL shortener takes a long URL and returns a short, unique alias. When a user visits the short link, the service looks up the original URL and redirects them. The mechanics fit in a sentence — which is exactly why it's a classic interview problem. The interesting decisions only surface once you push on scale, and a strong candidate is expected to uncover them rather than be handed a checklist.

Practice workspace

Guided practice or a locally saved 45-minute mock.

Step 1 of 8

Functional Requirements

What are the two essential user flows, and what would you explicitly leave out of version one?

Reference solution hidden

Try answering in the workspace above first. Reveal the full worked solution — data model, architecture, and trade-offs — whenever you want to compare.