Pregunta de entrevista de Fidelity Investments

They asked me to debug code and write a function in C++