Publicis Sapient interview question

Logic to detect cycle in linked list.