Bloomberg interview question

writing coding question