QVT Financial interview question

Coding exercises.