Pregunta de entrevista de Samsung Electronics

Print the loop nodes in a directed cyclic graph?