Pergunta de entrevista da empresa Microsoft

How to find if there is a cycle in a tree?