Jane Street interview question

Dynamic programming and expected value