Cognizant interview question

Sorting array, reversing string in python