Pregunta de entrevista de Signify

What is the optimal way to solve the string reverse?