Cognizant interview question

Reverse a given string in java