Bloomberg interview question

The coding question was not hard.