UBS interview question

Technical question 1