RxLogix Corporation interview question

How to check wether a list is loop or not? PseudoCode.