TBO.com interview question

String comparison and then sort