Tiger Analytics Interview Question

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