Bloomberg Interview Question

Coding question