AlgoViz

Scoping and clarifying

easy 30 min

The prompt is vague on purpose.

Chapter mnemonic

Eight non-functional design checks

Cats Eat Sweet Lemons, Drinking Sugar-Free Coffees.

Which two checks hide inside Sugar-Free?

Security and fault tolerance.

Video lesson · Chapter 1 of 5

A bus with an audience of one

0:00 / 3:41

Five minutes of scope

1:20Reel coming soon

Theory

Read or listen first. About 1 min.

What it is

Scoping is agreeing what will be built, how well it must work, and what is left out. Clarifying is asking the few questions whose answers would change the design.

The result is short: about three features, a handful of targets and a list of what is out.

Why it exists

Two people can hear the same sentence and imagine different systems. Five minutes of scoping is cheaper than forty minutes of designing the wrong thing.

It also protects your time. A small agreed scope can be finished.

A short history

  1. 1970s to 1980s

    Requirements become a field of study as large software projects miss what users needed.

  2. 1994

    Dai Clegg describes MoSCoW: must, should, could and won't have.

  3. Late 1990s

    User stories describe a need from the user's side in a sentence or two.

  4. 2000s

    Service level objectives turn "fast" and "reliable" into agreed numbers.

Words to know

Feature
Something a user can do.
Target
A quality with a number and a path it applies to.
p99
The time that 99 of 100 requests beat.
Out of scope
Named and agreed not to be built now.
Assumption
Something you state and go on with.

How it works

Step through the idea, or press Play.

Step 1 of 3

Ask. Only questions whose answer changes the design

Understand it

Start here

Ordering a cake

A customer walks into a bakery and asks for "something lovely, fast". A poor baker starts mixing. A good baker asks a few short questions, writes four lines and reads them back. Scoping is that conversation.

From a wish to an order
ORDER20 peopleSaturday, 3 pmNo nutsOut: delivery?Something lovely, fast!A vague wish

What you leave with

Five lines in the corner of the board

LineRecipe sharingSchool bus tracker
FeaturesPost a recipe, view one, search by ingredientParent sees the bus, bus reports, school sets routes
Scale1M daily users, 20 views each, 10,000 posts a day2,000 buses, 100,000 parents, all at 7:45
TargetsPage in 300 ms for 95 of 100 requests; search in 500 msPosition at most 10 s old; 99.9% on school mornings
NeverA posted recipe disappearsA stranger sees a child's stop
OutComments, meal plans, shop linksPayments, driver chat, route planning
The numbers are assumptions agreed with the interviewer.

The order of the five minutes

Features

Choosing about three

List the actions quickly, then pick. Two tests help. Without it, is this still the product? And: does it carry the hard part? Keep what passes the first, make sure one passes the second, and put the rest in a visible "later" list.

Recipe sharing: six candidates

ActionStill the product without it?Carries a hard part?Decision
Post a recipeNoPhoto storageIn
View a recipeNoRead loadIn
Search by ingredientHardlySearchIn
Save a favouriteYesNoLater
CommentYesNoLater
Weekly meal planYesMaybeOut

Why not eight?

10 min of design3 features≈3.3 min each,108=1.25 min each\frac{10\ \text{min of design}}{3\ \text{features}} \approx 3.3\ \text{min each}, \qquad \frac{10}{8} = 1.25\ \text{min each}
In 75 seconds you can name a feature but not design it.

Targets

Turn the adjective into a number

"Fast", "reliable" and "scalable" cannot fail a test, so they cannot guide a design. A target has what is measured, a number and for how many. Propose one yourself; it is easier to correct a number than to invent one.

Words into targets

They sayAskPropose
FastWhich action, and how fast is good?"Opening a recipe: 95 of 100 requests under 300 ms, measured at our edge."
Real-timeHow old may it be?"A bus position at most 10 seconds old."
Always upWhat does an hour down cost?"99.9% a month: 43 minutes."
ScalableHow many today, and in a year?"1M daily users, design for three times the average at peak."
Never lose dataWhich data, after which failure?"A confirmed booking survives one machine or disk."
SecureWho must not see what?"Only a parent of that child sees the stop."
CheapCompared with what?"One database as long as the numbers allow."

What 99.9% allows

30 days×24×60=43,200 min,0.1%=43.2 min,0.01%≈4.3 min30\ \text{days} \times 24 \times 60 = 43{,}200\ \text{min}, \qquad 0.1\% = 43.2\ \text{min}, \qquad 0.01\% \approx 4.3\ \text{min}
With 4.3 minutes a month a person cannot wake up and fix it. 99.99% therefore forces automatic failover. That is a target changing the design.

Questions

Ask only what changes the design

Before you ask, finish this sentence: "If they say A, I would..., and if they say B, I would...". If both endings are the same, skip it or assume it aloud.

Should I ask this?

Six questions that often change the design

  • Private or public?

    Public answers can be cached for everyone at the edge. Private ones need a check for each viewer.

  • How old may it be?

    Ten seconds allows polling and caches. Under a second points to an open connection.

  • Can two people want the same thing?

    If yes, you need a rule that lets one win. If no, writes are easy.

  • How big is one item?

    A kilobyte lives in a database. A video needs object storage and a CDN.

  • Does everyone arrive together?

    A 9:00 rush breaks designs that the daily average says are fine.

  • What if we lose one?

    A lost bus position is replaced in seconds. A lost payment is a disaster.

Changes the design

  • "Can a seat be held before paying?"
  • "Is search over our recipes or the whole web?"
  • "Do parents need yesterday's route?"
  • "One region or worldwide?"

Changes nothing yet

  • "Is there dark mode?"
  • "Which cloud provider?"
  • "How long is a user name?"
  • "What colour is the bus?"

Worked example 1

School bus tracker, word for word

Five minutes

  1. Interviewer

    Design a school bus tracker.

  2. You

    Who looks at it? I imagine parents, and perhaps the school.

  3. Interviewer

    Parents mostly. The school sets up routes.

  4. You

    Then three features: a bus reports where it is, a parent sees the bus for their own child, and the school assigns children to stops. How many buses and parents?

  5. Interviewer

    Say 2,000 buses and 100,000 parents.

  6. You

    And they all look at about the same time in the morning?

  7. Interviewer

    Yes, around 7:45.

  8. You

    How old may a position be? If ten seconds is fine I can start with simple polling. If it must be one second I need open connections from the start.

  9. Interviewer

    Ten seconds is fine.

  10. You

    One thing must never happen: a stranger finding out a child's stop. Payments, driver chat and route planning are out. To say it back: parents see only their own child's bus, at most ten seconds old, for 2,000 buses and 100,000 parents at 7:45, and privacy comes before freshness. Is that right?

  11. Interviewer

    That is right.

Worked example 2

Parcel lockers: one prompt, two scopes

"Design parcel lockers for an office block." The same prompt gives two different systems, depending on one answer.

QuestionIf the answer is AIf the answer is B
One building or a city?One building, 200 lockers: one service, one database5,000 sites: lockers must work when the network is down
Who opens it?Staff badge: use the existing sign-inAnyone with a code: codes must expire and resist guessing
Two couriers, one locker?Cannot happen, one courier a dayCan happen: claim a locker with a conditional update

Edges

Saying what is out

Out of scope is a decision that they can object to at minute 4, when changing it is cheap. Give a short reason, and say what stays possible.

  1. 1

    Name it

    "Comments are out for now."

  2. 2

    Say why

    "They are ordinary writes and would not change the design."

  3. 3

    Leave the door open

    "A recipe has an ID, so they can be added later."

  4. 4

    Invite a correction

    "Tell me if you would rather see them than search."

Hard rooms

Vague, hostile and silent answers

They answerIt may meanYou say
"What do you think?"They want you to lead"I will assume one million daily users. I will change it if the design depends on it."
"All of them."They want to see you choose"Then in this order: post, view, search. I will stop at three unless we have time."
"Why does that matter?"Test of purpose, not an attack"If photos are private I cannot cache them for everyone. That changes the edge."
"Just design it."Too many questions"Two assumptions, then I draw: public recipes, 10,000 posts a day."
"Facebook scale."No number in mind"Let me call it 1 billion daily users, and say what would be simpler at one million."
"Zero downtime, zero loss, cheap."They want a trade-off"Those pull apart. I would protect bookings first, then uptime. Is that your order?"
SilenceWriting, or waiting"I will take that as a yes and go on. Stop me if not."

When no clear answer comes

A cold interviewer

  1. You

    How many recipes are posted each day?

  2. Interviewer

    You are the engineer. You tell me.

  3. You

    Then I will assume 10,000 a day and write it here. At that size writes are tiny, one every nine seconds, and photos are the volume. At ten million a day I would split the data. I will design for 10,000.

  4. Interviewer

    Fine.

Changes

When the scope moves later

At minute 30 they may say "now make it worldwide". Do not start again. Say what survives, what breaks, and the smallest change.

A new requirement at minute 30

Summary

The whole topic in one minute.

Choose about three features, give each important quality a number, say what is out, and repeat it back.

Ask questions whose answers change the drawing. Assume the rest out loud.

  • About five minutes, about three features.
  • A target has a measure, a number and for how many.
  • Ask only if the two answers lead to two designs.
  • Say what is out, and never park the hard part.
  • One sentence back. Then draw.

Sources