TeamViewer interview question

I was asked to reverse a String