AlgoViz

How to think about any design

easy 30 min

You do not need to have seen the problem before.

See it run

Watch the thinking happen on a prompt you have not seen, then on ride hailing.

Operations

Five questions

The prompt: let readers book a study seat in the city's libraries. Answer five questions before drawing.

Step 1 of 5

Who does what?

AskAnswer
Who does what?Reader books a seat
Never wrong?
Hardest?
Breaks first?
Giving up?

Readers look for a free seat and book it. Librarians block broken seats. Two actors, three actions.

Step 1: Who does what?

When
First 10 minutes
You leave with
The hard part, named

If question 3 has no answer yet, keep asking. A design without a hard part usually means you missed it.

In the real world

The same how to think about any design doing real jobs. Pick one and step through it.

Six prompts from the original drill. Choose before you press next.

Step 1 of 12

Live chat

You hearWhich part helps?
real timeWebSockets / SSE
Elasticsearch
Message queue
CDN

You are designing a live chat application. Real-time messaging.

Step 1: Live chat

Common mistakes

The bugs interviewers watch for, with the fix beside each.

  • Drawing before asking

    critical

    You may design the wrong system very well.

    Wrong
    "I'll start with a load balancer, Kafka and..."
    Right
    "Who uses it, and what must never go wrong?"
  • Reaching for a part on a keyword

    major

    Words suggest parts. Without a number the part may be pure cost.

    Wrong
    "Real time, so WebSockets."
    Right
    "It changes three times an hour, so polling is fine."
  • Adding everything at once

    major

    Nobody can tell which box solves which problem, including you.

    Wrong
    "Here is the final architecture."
    Right
    "Version 1 works. It breaks at 9:00, so next I add..."
  • Listing options without choosing

    major

    The interviewer wants to see your judgement.

    Wrong
    "We could use A, B or C."
    Right
    "B, because of X. It costs Y. I would switch if Z."

Interview tips

  • Five questions

    • Who does what?
    • What must never go wrong?
    • What is the hardest thing?
    • What breaks first?
    • What am I giving up?
  • Four steps

    • Know the skeleton.
    • Find the hard part.
    • Define the data flow.
    • Plug in the special parts.
  • When you freeze

    • Reread the targets.
    • Ask which one fails today.
    • Fix that one.
  • Signs you are off track

    • You cannot say why a box is there.
    • You have spent five minutes on the easy part.
    • The interviewer has asked the same thing twice.