Jane Street interview question

Difficult functional programming questions.