Microsoft Interview Question

Detect loop in an undirected graph