← Questions

Detect and break a cycle in a linked list

0
AmazonCodingLast asked Jun 2026

A coding interview question asked in Amazon's technical phone screen, last asked Jun 2026. It tests linked lists and two pointers.

Given the head of a singly linked list, decide whether it has a cycle. If it does, find the node where the cycle begins and break the cycle by setting the next of the last node in the cycle to None, so the list ends.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Amazon · Technical phone screen · Last asked Jun 202660 min · Live coding in a shared editor that does not run code, plus Leadership Principles questions · No AI

What it tests

linked lists · two pointers

Your code and the AI tutor open when you unlock this question.