UBS interview question

Math and Pattern Recognition Based