Bloomberg interview question

Some DP problems