Apple interview question

Design an algorithm to check if two words are anagrams.