Cognizant interview question

Questions on sorting