Microchip interview question

write code for linked list loop detection and removal. write code for dfs