Interactive Lab · Foundations
Big-O isn't about how fast your code runs once. It's about how the work grows as the input n gets bigger. Drag the n slider and watch six algorithms race: some barely notice, one becomes literally slower than the age of the universe. This is why picking the right algorithm beats buying a faster computer.
🎬 Watch the 50-second explainer, then try it yourself below ↓
▶ The playground, drag n and watch the curves diverge
| complexity | operations at n | time @ 1 billion ops/sec |
|---|
The code behind each class
Big-O is the shared language of every code review and system-design interview: it's how you justify an index (O(log n) beats O(n)), reject a nested loop over a million users, and predict which service falls over first at 10× traffic. The exponential wall you just hit is why cryptography works and why brute-force never ships.
Set n = 10. Every curve is basically fine, right? Now drag n up to 50. Before you look: which curve blows past all the others first, O(n²) or O(2ⁿ)? Keep dragging toward 90+: one algorithm needs longer than the universe has existed to finish. Now ask yourself: a computer 1000× faster, does it save the O(2ⁿ) algorithm, or just buy you ~10 more units of n?
The takeaway