Pergunta de entrevista da empresa Johnson Controls

Devise an algorithm to check if two strings are anagrams.