← Morgan Stanley questions
CodingReported in a candidate post, Mar 2022

Sort a HashMap by values

Filed under Morgan Stanley · Also reported at Tatvasoft

Given a HashMap (key to value), sort its entries by value and return them in that order. State how you would do it in Java, since a HashMap itself has no ordering.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Morgan Stanley questions

Collected from public candidate posts and coding forums. Updated Nov 2026.