Qualcomm Interview Question

Sorting and searching for an element in an array the best way