CDK Global interview question

Write an API method to reverse a string