Pergunta de entrevista da empresa Fidelity Investments

Based on some sorting and ordering.