J.P. Morgan interview question

C++ related questions about dynamic programming