Skip to content
Sharp

System Design · interview question

During a live coding session, you're asked to calculate the time complexity of your solution. What is the time complexity of a binary search algorithm?

Multiple choiceHardchapter-20-curatedpremiumsystem-designdefending-tradeoffs
Choose one answer
Answer and explanation

Correct answer

B. O(log n)

Why

Binary search has a time complexity of O(log n) because it divides the problem size by half at each step, efficiently narrowing down the search range in a sorted array.

Test yourself on System Design

A free test with instant, explained results. No account needed.

Start free test
All System Design questions →