Applied Materials interview question

Write code to reverse a string