Papaya Global interview question

binary search code, pseudocode, and program.