Salesforce interview question

basic array problems and binary search interval problem