AlphaSights interview question

How's the binary search works? time complexity