The model
Work grows in one of five shapes
When the volume of a process grows, the work in that process grows in one of five shapes. Engineers name the shapes with Big O notation, shown under each name below for anyone who wants to look the terms up.
The shape matters more than the speed. A slow process with a gentle shape will eventually cost less than a fast process with a steep shape. Big O notation ignores the speed on purpose: a method that takes 3 steps per item and a method that takes 100 steps per item are both O(n), because both double when the volume doubles.
The examples marked “From the reel” are the figures from the Instagram reel this page is based on, where the creator ran each algorithm and counted the steps.
Flat
O(1)
The work stays the same whatever the volume. A published returns policy answers the same question for every customer, and a rule set once in a system applies to every order.
From the reelAsking a computer for item 50 in a list takes one step, whether the list holds 100 items or 100 million.
Slow-growing
O(log n)
The work grows by one step each time the volume doubles. A triage form where each question halves the remaining options works this way, and so does a filing system sorted by customer number.
From the reelBinary search found one name among a million in 20 comparisons.
Straight-line
O(n)
Double the volume and the work doubles. A person who keys in every invoice by hand, or an agent who answers every support ticket from scratch, does straight-line work.
From the reelSearching a million usernames one at a time took 987,413 checks, and doubling the list doubled the checks.
Every-with-every
O(n²)
Each item is compared or coordinated with every other item, so ten times the volume means a hundred times the work. The payment matching in the first question is every-with-every work, and so is a decision that needs everyone in a group to agree with everyone else.
From the reelComparing every user with every other user took 10,000 checks for 100 users and 1,000,000 checks for 1,000 users.
Explosive
O(2ⁿ)
Each new option doubles the number of combinations. A product where customers can switch 20 features on or off has 1,048,576 possible versions to price, support and test.
From the reelAt a billion steps a second, an explosive method with 100 items would take about 40 trillion years. The universe is 13.8 billion years old.
Engineers use a sixth shape, O(n log n), for sorting. Sorting grows a little faster than straight-line work and far slower than every-with-every work. That gap is why sorting or indexing a list first is often the cheapest way out of every-with-every work.