Fidelity Investments interview question

My coding background