Cognizant interview question

Write program to Reverse The String?About the socket concept