Samsung Electronics interview question

Write a script to reverse a string