HP Inc. Interview Question

Datastructure question: detect loop in link list