Bloomberg Interview Question

really detailed C++