Pergunta de entrevista da empresa Apple

Design an algorithm to check if two words are anagrams.