Filter interviews by
I appeared for an interview in Apr 2024.
To detect a cycle in a linked list, use Floyd's Tortoise and Hare algorithm.
Initialize two pointers, slow and fast, at the head of the linked list.
Move slow pointer by one step and fast pointer by two steps. If they meet at any point, there is a cycle.
If fast pointer reaches the end of the list without meeting slow pointer, there is no cycle.
Floyd's tortoise and hare algorithm is used to detect a cycle in a linked list.
The algorithm involves two pointers moving at different speeds through the linked list.
If there is a cycle, the two pointers will eventually meet at the same node.
This algorithm has a time complexity of O(n) and space complexity of O(1).
Top trending discussions
I applied via Naukri.com and was interviewed before Jun 2021. There were 2 interview rounds.
I applied via Naukri.com and was interviewed before Jan 2021. There were 3 interview rounds.
I applied via Naukri.com and was interviewed in Feb 2022. There were 2 interview rounds.
posted on 12 Feb 2025
Aptitude and coding logis asked
Few coding questions and MCQ based
based on 1 interview
Interview experience
Technical Recruiter
25
salaries
| ₹2 L/yr - ₹4.8 L/yr |
US IT Recruiter
13
salaries
| ₹2.2 L/yr - ₹3.9 L/yr |
Senior Software Engineer
9
salaries
| ₹17 L/yr - ₹25 L/yr |
HR Manager
6
salaries
| ₹4.1 L/yr - ₹8.5 L/yr |
Information Technology Recruiter
6
salaries
| ₹3 L/yr - ₹5.2 L/yr |
Randstad
Innovsource Services
eTeam
IMPACT Infotech