TIAA Interview Question

reverse a string by particular given