Farhan Ali29 days agoMost voted7
Roughly:
- requirements first (shorten, redirect, custom alias? expiry? how many urls?)
- API: POST to create, GET /code redirects
- code generation: base62 of an auto increment id is the simplest, hashing needs collision handling
- storage: key value is enough
- it's read heavy, so cache popular codes
Mention sharding at the end, nobody expects depth from a fresher.