HCLTech interview question

They asked to write a code to reverse a string