Delete the Middle Node of a Linked List
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Given the head of a linked list with n nodes, remove its **middle** node and return the head of the modified list.
The middle node is the one at 0-based index floor(n / 2): for n = 1, 2, 3, 4, 5 that is index 0, 1, 1, 2, 2. Removing the only node of a one-node list leaves an empty list [].
Aim for a single pass using two pointers.
Examples
Constraints
- 1 <= number of nodes <= 10^5
- 1 <= Node.val <= 10^5
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.