UBS interview question

Reverse a string just psedocode