Java Zero to All All questionsPractise free
Interview questions › Java Foundations — Zero to Basics › Efficiency & Big-O — Measuring Speed From Zero

What does Big-O notation actually describe?

Level I · BeginnerEfficiency & Big-O — Measuring Speed From Zero
Short answer

It describes how the cost of an algorithm -- usually time, sometimes memory -- GROWS as the input size n grows, ignoring constant factors and lower-order terms.

Explanation

It answers 'if I make the input much bigger, how much more work is done?' rather than 'how many milliseconds does it take'. That makes it hardware-independent: O(n) means the work grows in proportion to n, O(n^2) means it grows with the square of n, regardless of the machine.

Common mistakes
  • Saying Big-O measures exact running time in seconds.
  • Forgetting it describes growth as input size increases.

Can you say this out loud in two minutes? Drill it in a timed mock interview, with flashcards and runnable code for Efficiency & Big-O — Measuring Speed From Zero.

Practise free

More on Efficiency & Big-O — Measuring Speed From Zero