Pergunta de entrevista da empresa Signify

What is the optimal way to solve the string reverse?