Hudson River Trading interview question

Coding question - very hard