Fidelity Investments Interview Question

Question relating to architecture and performance improvement techniques of the code