Cognizant interview question

Algorithm Question like logarithm and search