MockDojo

Question bank, System design, Classic warm-up

Design a URL shortener

Design a URL shortening service like bit.ly: users submit a long URL and get a short link that redirects.

35 minutes, for junior, mid-level, senior engineers

How the interview runs

  1. 1.Requirements. Before we design anything: what are the core functional requirements, and which non-functional ones matter most here?
  2. 2.Estimates. Let's size it. Assume 100 million new links per month and a 100:1 read-to-write ratio.
  3. 3.API + data model. What does the API look like, and how would you model and store the data?
  4. 4.High-level design. Walk me through the high-level architecture, request by request.
  5. 5.Deep dive. How do you generate short codes so they're unique and short, and how do you make redirects fast?
  6. 6.Trade-offs + failure. What are the main trade-offs you made, and what happens when a component fails?

What you're graded on

  • Clarified requirements15 pts
  • Back-of-envelope estimates10 pts
  • Clear API10 pts
  • Data model + storage choice15 pts
  • Coherent architecture15 pts
  • Key generation + fast redirects20 pts
  • Trade-offs8 pts
  • Failure handling7 pts

Practice this one for real

Answer it phase by phase, then get the rubric score, what you missed and the model answer outline.

Unlock with Lifetime