Infosys interview question

Cursor life cycle, string reversal