CodingReported in a candidate post, Aug 2021
Find a cycle in an undirected graph
Filed under LinkedIn
The question
The candidate was asked to detect a cycle in an undirected graph; they used union-find and were asked why not DFS and about the complexity.
No write-up yet. Related questions below have one.
Related LinkedIn questions
Collected from public candidate posts and coding forums. Updated Nov 2026.