System DesignHard
How would you design a URL shortener that handles 10k req/s?
Hot path is a key-value lookup — Redis in front of Postgres handles it. Generate IDs with a base62 encoding of a snowflake. Use a write-through cache so reads never touch the DB after the first miss.
For analytics, append to a queue (Kafka / Kinesis) and aggregate offline.