Cognizant interview question

Reversal of string