Goldman Sachs Interview Question

Explain the algorithm used in your internship