Midpoint Pointers
Easy · Onsite · New graduate
They asked me to find the middle element of a linked list in the most optimized way during the campus technical round. I explained the slow and fast pointer approach instead of counting the list length first, and they seemed to appreciate that I went straight to the efficient solution. The interviewer pushed on what happens when the list has an even number of nodes and which middle I'd return. I clarified the difference and showed how adjusting the loop condition changes which one you land on. This came after an MCQ-style online assessment and group discussion, so it was the first real coding question in the process.
