Code RoomShort-link redirect and analytics
MediumPrep Room Coding #4604

Short-link redirect and analytics

System designDistributed systemsMid–Senior~35 min

Design a branded short-link + click-analytics service for a marketing platform (think a Bitly for enterprise). Scale: ~5K new links/day but ~200K redirects/sec at peak (links go viral), redirect latency must be <30ms p99 globally, and each redirect must record an analytics event (timestamp, geo, device, referrer) without slowing the redirect. Requirements: custom aliases with collision handling, optional expiration, and near-real-time click counts in a dashboard. The focus is the redirect hot path and analytics ingestion, not the ID-generation puzzle.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.