Qualcomm interview question

Linked List - check for cycle