Infosys interview question

mostly about overlapping concepts and dynamic programming