Pregunta de entrevista de Salesforce

basic array problems and binary search interval problem