Route · step 29 of 34 · 14 pages · about 14 minDesign a URL shortenerThe classic first interview question, worked end to end: agree the requirements, estimate, two calls, one table, then fix one wall at a time.Start reading →New words you’ll learnRedirectStatus codeBuilds on1Who is sending the traffic?script6Cache-asidecache, cache-aside15Read replicasread replica (standby), primary, replicaPage by page1The brief: make long links shortThe brief2Estimate: 40 new links a second, 12,000 opensA technique3The API: two callsA technique4The data: one table, looked up by codeA technique5The first design, at the busiest hourThe problem6A cache answers the popular linksThe fix7Answer redirects at the edge, or count every clickA trade-off8Making the codes: three ways, one good oneA technique9A script makes millions of linksThe problem10A limit for each callerThe fix11Copies of the database, and later shardsA technique12Production: Redis dies at 3 amKey idea13What each level is expected to showKey idea14Say it in two minutesRecap