Two Sigma interview question

A usual coding challenge .