Fidelity Investments Interview Question

My coding background