

Welcome to your interview for the Software Engineer role at Altana.
The question is on your right: Detect Cycles in Graphs. Take a moment with it first.
Talk your thinking through with me if you like - when you're confident, submit your answer and I'll grade it like a real screen. You have three graded attempts to score 7/10 or better.
Explain how to detect whether a graph contains a cycle. Cover both undirected and directed graphs, and describe what traversal state you would maintain in each case.