Bloomberg interview question

logic questions about programming