UBS interview question

Reverse words in a string