Google Interview Question

Optimise the given code of the query regarding Binary search