Two Sigma Interview Question

A usual coding challenge .