interviewmind

Practice room

Call time 00:00Get the app
D
Dana · Interviewer
You
You
Captions

Press Play and Dana asks the question out loud.

Questions10/17

System design

Design a URL shortener

Design a service that turns a long URL into a short link, like sho.rt/aZ3k9Q, and sends anyone who opens the short link on to the original URL with a redirect.

It takes about 100 million new links a month and keeps them for five years. Each link is opened about 100 times on average, and redirects peak near 20,000 a second. A long URL averages 500 bytes, and users can choose their own alias instead of a generated code.

Things to cover

  • Generating short codes, and how long they need to be
  • The data model, and where the links are stored
  • Keeping redirects fast: caching, and a 301 versus a 302
  • Custom aliases, collisions and abuse

Tab indents. Press Escape, then Tab, to move focus out of the editor.

MarkdownLn 1, Col 1
Practice room — InterviewMind