Skip to content
whiteboard.tools
  • System design
  • Interviews
  • Architecture

Whiteboarding a system design interview: what to draw, and in what order

A drawing order for system design interviews: requirements, numbers, API, data, boxes, then one deep dive. Worked through on a URL shortener.

By 5 min read

A whiteboard split into four zones: requirements, estimates, API and a box-and-arrow sketch of a URL shortener

Most system design interviews go wrong on the board before they go wrong in the conversation. The candidate draws a load balancer in the first minute, three services in the second, and by minute ten there is a dense knot of boxes that nobody, including the candidate, can explain in order.

The fix is not drawing better. It is drawing in a fixed order, so the board tells the story of how you thought about the problem. Here is the order I recommend, worked through on the question everyone gets at least once: design a URL shortener.

Split the board before you draw anything

Divide the space into four zones before the first box. Top left for requirements, top right for numbers, bottom left for the API and data model, and the large remaining area for the architecture.

This takes ten seconds and does two things. It stops the architecture from eating the whole board, and it gives the interviewer a place to look when they want to check something you said earlier. When they ask "how many writes per second did you say?", you point at the corner instead of scrolling back through your memory.

1. Requirements: write them as a short list, then cross things out

Write what the system must do in four or five lines. For the URL shortener:

  • Create a short link for a long URL
  • Redirect a short link to its long URL
  • Optional custom alias
  • Links expire after a set time
  • Click counts per link

Then ask which ones are in scope, and strike through the ones that are not instead of erasing them. A crossed-out "custom alias" shows you thought of it and chose to defer it. An erased one looks like you never considered it.

Add two or three non-functional lines underneath: redirects must be fast (say under 50 ms at the 99th percentile), short codes must not collide, and analytics can lag behind by a few minutes.

That last line matters more than it looks. It is permission to make analytics asynchronous later, and you wrote it down before you needed it.

2. Numbers: just enough to make a decision

You do not need a spreadsheet. You need the two or three numbers that change the design. For a URL shortener the important one is the read-to-write ratio.

100M new links / month   ≈ 40 writes/s (peak ~200)
100:1 reads to writes    ≈ 4,000 redirects/s (peak ~20,000)
500 bytes per record     ≈ 50 GB / month, ~3 TB over 5 years

Now you have a reason for every later choice. Twenty thousand redirects a second against a few hundred writes says "cache the read path aggressively". Three terabytes says "this fits comfortably in a key-value store, no sharding heroics needed on day one".

Circle the number that drives the design. Interviewers notice when an estimate actually gets used.

3. API and data model: the contract before the boxes

Two endpoints are enough:

POST /links        { url, alias?, expiresAt? } → { code }
GET  /{code}       → 301 or 302 to the long URL

Say out loud whether you return 301 or 302. A 301 is cached by browsers, which takes load off you but means you will not see repeat clicks. A 302 keeps every redirect coming through your servers, which is what you want if click counts are a requirement. This is the kind of small trade-off that separates a memorised answer from a reasoned one.

The data model is one table, or one key-value pair: code → (long_url, created_at, expires_at, owner). Draw it as a small box with the fields listed. Keep it on the board; you will come back to it.

4. The architecture: draw the request path, left to right

Only now do you draw boxes, and you draw them in the order a request travels. For the redirect, that is:

  1. Client
  2. Load balancer
  3. API servers (stateless, so you can add more)
  4. Cache
  5. Key-value store

Draw the redirect path first because it carries 99% of the traffic. Then add the write path underneath: the API servers ask an ID generator for a unique number and base62-encode it into a seven-character code. Seven characters of base62 gives about 3.5 trillion codes, which you can check against your five-year estimate in the corner.

Last, the analytics path: the API server drops a click event on a queue and returns the redirect immediately. A worker consumes the queue and updates counts. Draw the queue and worker in a different colour or with dashed arrows, because they are off the critical path. That visual difference is your "analytics can lag" requirement made visible.

Label every arrow. "Lookup code", "miss → read", "enqueue click". An unlabelled arrow invites the question "what goes over this?", and you want to choose which questions you get.

5. One deep dive, chosen by you

You will not have time to go deep on everything. Pick the part with the most interesting failure mode and offer it: "The part I would want to get right is ID generation. Can I go deeper there?"

For the shortener, the options worth discussing are:

  • Counter with ranges: each API server leases a block of 10,000 IDs from a central counter. No collisions, and the counter is only hit once per block.
  • Hash of the URL: simple, but you have to handle collisions and two people shortening the same URL get the same code.
  • Random codes: easy to generate, but you need a uniqueness check on every write.

Draw the one you choose next to the ID generator box, small. Do not redraw the whole system.

Mistakes that are visible from across the room

Starting with technology names. "Kafka" and "Redis" are answers. Write "queue" and "cache" first, and name a product only when someone asks or when its specific behaviour matters.

Arrows in both directions everywhere. If every connection is two-headed, nothing tells you who calls whom. Draw the direction of the request.

No space left for the deep dive. If the architecture fills the board edge to edge, the most important five minutes of the interview happen in a cramped corner. The four zones exist to prevent this.

Silent drawing. Narrate as you draw. The interviewer is grading your reasoning, and the board is only evidence of it.

Practise on a real board

Practising out loud with a timer is worth more than reading another design write-up. Open the URL shortener template, cover it, draw your own version in fifteen minutes, then compare. The three-tier web app and microservices templates are good second rounds, and the cloud architecture shapes give you vendor-neutral icons for queues, caches and stores so you are not drawing a database cylinder from scratch every time.

The goal is not a beautiful diagram. It is a board where someone who walked in at minute twenty could read, top left to bottom right, how you got to your design.

Try it on a board

More articles