Media.net interview question

One question on simple implementation on dynamic programming.