IDEA Foundation interview question

wap to reverse a string