Big-O notation describes how an algorithm's work grows as its input gets larger. It ignores machine speed and focuses on the shape of that growth.
The problem it solves is fair comparison. A fast laptop can make a bad algorithm look quick on tiny inputs. Big-O strips away hardware and fixed setup, so you see which method wins once data gets big.
You also use it to predict scaling. Say your report takes one second on a thousand rows. Big-O tells you whether a million rows means minutes or days.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Your report takes 1 second on 1,000 rows. Roughly how long on a million rows if it's O(n), versus O(n^2)?Scale by the ratio. Rows grow 1000x, so time grows 1000x for O(n) but 1000 squared for O(n^2), which is minutes versus days.
Big-O describes how an algorithm's work grows as its input gets larger, and it ignores how fast the machine is.
The problem it solves is fair comparison, because a fast laptop can make a bad algorithm look quick on tiny inputs.
Big-O strips away hardware and fixed setup costs, so you see which method wins once the data gets big.
I also use it to predict scaling, like knowing whether a report that takes one second on a thousand rows will take minutes or days on a million.
The trade-off is that it hides constant factors, so on small inputs the algorithm with the worse Big-O can still be faster, and I'd measure before choosing.
Weak answers to avoid
Says Big-O measures how fast code runsBig-O says nothing about seconds. It describes how work grows with input size, which is why it holds on any machine.
Defines it but skips the problem it solvesThe question asks for the problem too. Name fair comparison across hardware and predicting how cost grows when data gets bigger.
Claims a lower Big-O is always fasterBig-O ignores constants, so at small sizes the worse class can win. Say it predicts behavior at scale, and you measure at the sizes you actually run.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.