Fidelity Investments interview question

Based on some sorting and ordering.