Capgemini Engineering interview question

Binary search and string matching question