JMAN Group Interview Question

How to reverse a string with proper working code.