AlgoViz

Numbers that decide

easy 35 min

An estimate is worth doing when its answer changes what you draw.

See it run

Four sums, each ending with a decision, and a drill for the sums to skip.

Operations

Per day to per second

Recipe pages: from a daily total to a decision in four lines.

Step 1 of 5

Assume

StepWorkingResult
Assume1M users × 20 views20M a day
Average
Peak
One database
So

One million daily users, 20 recipe views each: 20 million a day.

Step 1: Assume

When
Under a minute
You leave with
Peak reads a second

Take five zeros off the daily total. That is the average.

In the real world

The same numbers that decide doing real jobs. Pick one and step through it.

Recipe sharing. Which sums are worth a minute?

Step 1 of 8

Photo bytes out

The numberWorth a minute?
Photo bytes outCalculate
Skip it

600 pages a second, four photos of 500 KB.

Step 1: Photo bytes out

Common mistakes

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

  • A sum with no decision

    major

    Minutes pass and the design does not change.

    Wrong
    "So that is 51 billion a month."
    Right
    "So 600 a second at peak: one database."
  • The average for a rush

    critical

    The system fails at 9:00, the only time that matters.

    Wrong
    "200 a second, easy."
    Right
    "20,000 people every 4 seconds: 5,000 a second."
  • Bits and bytes

    major

    An error of eight times can change the answer.

    Wrong
    "10 Gb/s is 10 gigabytes."
    Right
    "Divide by 8: 1.25 gigabytes a second."
  • False precision

    minor

    The inputs are guesses.

    Wrong
    "11,574.07 a second."
    Right
    "About 10,000 a second."

Interview tips

  • Four sums

    • Rate and peak.
    • Storage over time.
    • Work in progress.
    • Machines.
  • Shortcuts

    • Day / 100,000.
    • Million a day is 10/s.
    • KB × million is GB.
    • Bits / 8.
  • Say

    • "I assume..."
    • "At peak..."
    • "So..."
  • Skip

    • Nothing depends on it.
    • Clear within ten times.
    • You will size it later.