Media.net Interview Question

One question on simple implementation on dynamic programming.