TIAA interview question

reverse a string by particular given