AlgoViz

From prompt to requirements

medium 35 min

The prompt is one sentence.

Video lesson · Chapter 1 of 6

Make a prediction

0:00 / 4:49

See it run

What each question buys: a method, a refusal, a lock, or nothing at all.

Operations

The seven measures

One question per theme. Watch what each answer turns into.

Step 1 of 8

One sentence

AskAnswerBecomes
Members
Events
Amounts
Sorry cases
Users at once
Rules
Edges

Design the laundry room of a student house. Nothing to build from yet.

Step 1: One sentence

Members       who starts something?Events        what happens, in order?Amounts       how many, how long?Sorry cases   full, late, twice, not yours?Users at once can two calls meet?Rules         which gets a second version?Edges         stored? screens? not today?
When
First three minutes
You leave with
Rows that become code

If the right column stays empty for both answers, the question was not worth asking.

In the real world

The same from prompt to requirements doing real jobs. Pick one and step through it.

Notes as people write them, and the sentences they become.

Step 1 of 6

Several floors

NoteSentenceMeasure
1several floorslayout is dataAmounts
2
3
4
5
6

How many is an amount. The layout becomes data that is read when the lot is built.

Step 1: Several floors

Common mistakes

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

  • A pattern before a fact

    critical

    No fact supports it yet, and you will defend it for the rest of the round.

    Wrong
    # first line on the boardclass LaundryRoom(Singleton): ...
    Right
    # first line on the board# R1  a resident can start a free machine of a kind
  • Adjectives

    major

    Nobody can test fast, secure or flexible. Say what must never happen.

    Wrong
    # must handle concurrency well
    Right
    # Q1  two panels never start the same machine
  • Full as a surprise

    critical

    The sorry case was never asked, so the caller meets an index error.

    Wrong
    machine = self._free[kind][0]
    Right
    machine = self._first_free(kind)if machine is None:    return None          # R6
  • Charging before finding

    critical

    R6 has two halves: nothing comes back, and no money moves.

    Wrong
    self._payments.charge(resident, kind.cents)machine = self._first_free(kind)
    Right
    machine = self._first_free(kind)if machine is None: return Noneself._payments.charge(resident, kind.cents)
  • A feature without a sentence

    minor

    It costs minutes that the hard part needs, and nobody asked for it.

    Wrong
    class NotificationService: ...
    Right
    # not now: messages. Would be a listener on the end of a cycle

Interview tips

  • Ask with a default

    • I assume that full is a normal answer. Right?
    • A nod is enough
    • Six questions in all
  • Number the sentences

    • R for what, Q for how well, A for assumed
    • R4 is quick to say later
    • Stop at ten
  • Listen for the hint

    • A long answer marks the hard part
    • A shrug means: you choose
    • Read back and wait two seconds
  • Fence aloud

    • Name it
    • Give a reason
    • Say where it would fit