View All num of num See all Photos Amazon.com www.amazon.com Engaged Employer Overview Reviews Salaries Interviews Jobs Photos Benefits 4.7k Reviews 11k Salaries 6.0k Interviews 10k Jobs Follow Add Interview Follow Add Interview Interview Question Software Engineer Interview Amazon.com Length of a circular linked list Tags: See more , See less 8 Answer Add Tags Answer Interview Answer 1 Answer ▲ 0 ▼ Let's take 2 pointers: first steps with step=1, second steps with step=2. If pointers meet, therefore there is a loop in a linked list.Statement: two pointers will meet in N steps.Indeed, let's imagine that such point is J. First pointer stepped J times, while second point stepped 2*J times, moreover, second pointer made additional k*N circles to J, i.e J+kN.2*J = J+kN, means J = kN, i.e. J is a multiple of N. Now there is need to demonstrate that k = 1. It can be proved by induction. Tim on Feb 1, 2014 Interviews > Software Engineer > Amazon.com Add Answers or Comments To comment on this, Sign In or Sign Up.