Thundersoft interview question

DSA question related to binary search