Design the database for a URL shortener

45 minutes3 follow-upsSubscribers

The room opens full screen with 45 minutes and no help, like the real thing. The clock never stops you. New to this? Do the tutorial first.

Checking your subscription…

How this interview works

  1. The interviewer gives you a vague problem, the way real ones do.
  2. Propose the requirements before designing, as you would in the first five minutes of a real one. The interviewer settles the scope, and the review grades your proposal.
  3. Write the schema. A hidden battery runs it on a real Postgres.
  4. 3 follow-ups change the requirements. Each opens once you pass 80% of the tests, and keeps every earlier test.
  5. Explain your decisions, then read the debrief and an annotated answer.
  6. Stuck on syntax? A Postgres syntax sheet is one tab away. The interview grades decisions, not memory.

The problem

Thanks for coming in. Let's design the database for a URL shortener, something like bit.ly: you paste a long link, you get a short one, and the short one redirects. Start by proposing the requirements: what it must do, how big it gets, what must never be lost. I'll settle the scope with you before you write anything.