Tiger Analytics interview question

Sort an array based upon frequency of elements. Reverse the elements of string without altering their order.