Bloomberg interview question

Algorithm questions