Quantlab interview question

How did you approach solving the problem?