Amazon interview question

There were 2 questions which was based on dynamic programming.