Design a URL Shortener
A URL shortener turns a long address into a short one, like https://s.example/aB3dE9k, and sends anyone who opens it to the original page. It has two operations: create a link and follow a link. Following happens about a hundred times more often than creating.
Most write-ups of this problem stop at the code generator. The follow-ups reported for xAI keep going: a flood of clicks on one link, click counts that never slow a redirect, expiring links, and malicious URLs. At our numbers that means hundreds of thousands of redirects a second, with one hot link able to grab a big share of them.
xAIPremium lesson · System design round
The xAI design, worked end to end.
- The API and data modelSystem design · Frequently asked
- The design, drawn out3 diagrams
- 5 deep divesWith the tradeoffs
$49 a year · all 107 companies · instant access
20,000+ candidate reports · guide updated
xAI interview guideKnow what xAI asks before you walk in.
24 coding · 4 system design · 15 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.