You are in a 45-minute system design interview. The interviewer gave you only the sentence above, on purpose. Part of the job is finding out what they actually want.
The service is public: anyone on the internet can create and open links.
Think of a product that already exists. A link like https://tiny.example/aZ3k9Qp should open https://www.example.com/blog/2024/a-very-long-article-title?utm_source=newsletter&ref=42.
Base62
Write a number using 62 symbols (a-z, A-Z, 0-9). 7 characters give about 3.5 trillion codes.
301 vs 302
301 is permanent and cached by browsers (less load, no click counting). 302 is temporary, so every click reaches you.
Cache-aside
The app checks the cache, and on a miss reads the database and stores the result in the cache.
Consistent hashing
Place keys and nodes on a ring so adding a shard moves only a small share of keys.
Read-heavy
Many more reads than writes (here 100 to 1), so optimise the read path first.
Decisions you confirm will collect here as you go.