Pergunta de entrevista da empresa Microsoft

Interesting question regarding tries and spell-checking.