SAP Interview Question

for the implementation task I was asked to check for a loop in a linked list