UBS interview question

Motivation