Detect a cycle in a linked list
A misbehaving feed handler built a linked list of messages, and a bug may have spliced a node's next pointer back to an earlier node, so traversal never terminates.
1 -> 2 -> 3 -> 4
^ |
+----+ # 4 points back to 3: cycle
Detect whether the list contains a cycle in time and space. A hash set of visited nodes works but costs memory, the interviewer wants Floyd's algorithm.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.