Bloomberg interview question

really detailed C++