HP Inc. interview question

Datastructure question: detect loop in link list