Pergunta de entrevista da empresa ADP

What is the fastest way to reverse a string in Java and C?