Two Sigma interview question

coding challenge with three questions on Hackerrank, with one question optional