ZZomato·DSASenior MLDSA Round

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.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account