Synopsys interview question

write a function to reverse a string