Pergunta de entrevista da empresa Red Hat

How would you write a program that checks if two words are anagrams and what is the performance of your program/algorithm using BigO notation.