Pergunta de entrevista da empresa Amazon

Find circular dependency in a dependency tree. Writing on the white board