As reported: Nutanix MTS-2, DevEx team (2026), coding round with two questions: Group Anagrams, then LRU Cache. Both were solved with working code; the rejection feedback was about code quality — clean, production-quality code is expected even when the interviewer says only the algorithm matters.
Given an array of strings strs, group the anagrams together (words that use exactly the same letters with the same counts). Return the groups in any order. This is LeetCode 49 — Group Anagrams.
Example 1
strs = ["eat","tea","tan","ate","nat","bat"] -> [["bat"],["nat","tan"],["ate","eat","tea"]]
Example 2
strs = [""] -> [[""]]
Constraints: 1 ≤ strs.length ≤ 10^4; 0 ≤ strs[i].length ≤ 100; lowercase English letters.
Code runner format: one JSON value: strs (LeetCode's format). Implement groupAnagrams(strs); groups and words may be in any order (the harness sorts them).