Anagram Check
viaGlassdoor
Problem: Given two strings, determine if they are anagrams of each other. Constraints: Case sensitivity and whitespace handling should be clarified with the interviewer. Approach: Count character frequencies in both strings (via hashmap or fixed-size array for a known alphabet) and compare; or sort both strings and check equality. Frequency-count approach is O(n) vs O(n log n) for sorting.
asked …