Quantlab Interview Question

How did you approach solving the problem?