Salesforce Interview Question

basic array problems and binary search interval problem