Newgen Software interview question

binary search