Big O Notation is a mathematical notation for describing how an algorithm's running time or memory use grows as its input grows — an upper bound on complexity (such as O(1), O(n), or O(n log n)) that lets engineers reason about and compare performance independent of hardware.
Big O Notation
Big O Notation is the language engineers use to describe how an algorithm scales. Rather than measuring milliseconds on one machine, it expresses the upper bound on how an operation’s time or memory grows relative to the size of its input — O(1) for constant cost, O(n) for linear, O(n log n) for a good sort, O(n^2) for a naive nested loop. It is a hardware-independent way to reason about performance before you ever run the code.
- Asymptotic upper bound - It captures worst-case growth as input size approaches infinity, so constant factors and small inputs are deliberately ignored.
- A shared vocabulary -
O(1),O(log n),O(n), andO(n^2)give teams a compact, comparable way to talk about the cost of an approach. - Complexity classes - It separates operations that scale gracefully from those that fall apart as data grows, guiding data-structure and algorithm choices.
- Space as well as time - The same notation describes memory footprint, not just execution time.
In API operations, Big O thinking shows up wherever an endpoint’s cost depends on how much data it touches: a search or filter that is O(n) per request will degrade as a dataset grows, and an unbounded query can turn into an O(n^2) liability under load. Reasoning in these terms helps API designers set sensible pagination and Rate Limiting, avoid N+1 query patterns behind an endpoint, and predict how a service will behave as usage — human or agent-driven — climbs. It is less a formal API standard than a foundational lens for building interfaces that stay fast at scale.