Delete the Middle Node of a Linked List
Problem Statement
You are given the head of a singly linked list with n nodes. Remove the middle node and return the head of the changed list.
The middle node is the one at index ⌊n / 2⌋, counting from 0. So for an even length it is the second of the two middles. For example: n = 1 → index 0, n = 2 → index 1, n = 4 → index 2, n = 5 → index 2.
head, the first node of a singly linked list.
The head of the list after the middle node has been removed (null if nothing is left).
n = 7, so the middle is index 3, the node with value 7. It is removed.
n = 4, so the middle is index 2, the node with value 3.
n = 2, so the middle is index 1, the node with value 1.
- • The list has between 1 and 10^5 nodes.
- • 1 ≤ Node.val ≤ 10^5
Pattern Recognition Clues
Recognising these key signals in the problem description immediately identifies the pattern:
Approach Complexity Ladder
Count n, walk n/2 − 1 steps, skip the next node
Start fast at head->next->next so slow stops one node before the middle
Count the nodes to get n. The middle is at index n / 2, so the node before it is at n / 2 − 1. Walk there from the head and set its next to skip the middle.
Recognition rule for this sub-pattern:
Unlock Complete Visual Walkthrough & Optimal C++
The interactive animated dry-run player, optimized C++ implementation, state invariant derivations, and edge-case breakdown for this question are part of Brute2Best Pro. The anchor question of every sub-pattern is completely free.
First anchor question per pattern, Part 1 LLD & Module 1 C++ basics are 100% Free forever.
How this concept connects to System Design & C++ Systems
Top engineering interviews test whether you understand how algorithms like Linked List — Fast & Slow translate into production architectures and low-level memory mechanics.
Foundations: Object-Oriented Principles in C++23
Class invariants, pure virtual interfaces, and RAII smart pointers.
Food Delivery System (Zomato Architecture)
Real-world machine coding application of algorithms and design patterns.
Pointers vs References Deep Dive
Pointer arithmetic and memory layout under the hood.
Virtual Method Table (vtable) & Memory Layout
Polymorphism, vptr overhead, and multiple inheritance in memory.