Bloomberg interview question

Standard algorithm questions