Thoughts2Binary interview question

Algorithm for binary search and also question about dynamic programimg