Squarepoint Capital interview question

There are two coding questions.