Partition List
A medium-tier problem at 59% community acceptance, tagged with Linked List, Two Pointers. Reported in interviews at Adobe and 6 others.
Partition List is a medium-difficulty linked list problem that shows up regularly at Adobe, Bloomberg, Amazon, Apple, Microsoft, and Google. You're given a linked list and a value x, and you need to rearrange nodes so all values less than x come before all values greater than or equal to x. The relative order within each partition should stay intact. It sounds simple until you realize you can't just swap node values, you're working with pointers. About 59% of candidates solve it, which means it's hitting the sweet spot between approachable and tricky. If you freeze on the pointer logic during the live assessment, StealthCoder surfaces a working solution in seconds while staying invisible to the proctor.
Companies that ask "Partition List"
Partition List is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made for the engineer who has done the work but might still blank with a webcam pointed at him.
Get StealthCoderThe trap is trying to partition in place by swapping values or rearranging in a single pass. The clean solution uses two separate lists: one for nodes less than x, one for nodes greater than or equal to x. You build both lists as you iterate through the input, then splice them together. The key move is maintaining dummy nodes at the head of each partition so you don't lose track of the start. Common mistakes include losing pointers mid-splice, forgetting to null out the last node of the second partition (critical to avoid cycles), or misunderstanding the inequality (is it less than or less-than-or-equal). Two Pointers shows up in the topic tags because you're managing two separate pointer chains simultaneously. This is exactly the kind of problem where the algorithmic insight is small but the execution has sharp edges. StealthCoder is the hedge for the live OA when the pointer logic gets tangled.
Pattern tags
You know the problem.
Make sure you actually pass it.
Partition List recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Partition List interview FAQ
Is Partition List actually asked at big tech companies?+
Yes. Adobe, Bloomberg, Amazon, Apple, Microsoft, and Google all report asking it. At 59% acceptance rate, it's a medium-difficulty screen filter, not a curveball. You'll see it in phone screens and early rounds, not final loops.
What's the main trick I'm missing?+
Two separate lists, not one. Build a 'less than' partition and a 'greater-or-equal' partition independently, then join them. Dummy nodes save you from tracking edge cases. The gotcha is nulling out the tail of the second list to prevent cycles.
Why does this trip people up if it's medium difficulty?+
Pointer manipulation under pressure feels fragile. You're juggling three or four pointers (two list heads, two list tails, input pointer) and splicing them at the end. One forgotten null and you've got a cycle. One off-by-one and you skip a node.
How does this relate to Two Pointers as a technique?+
You're maintaining two separate pointer chains in parallel, not a fast/slow convergence. It's a different flavor of two-pointer work. Understanding this problem makes you comfortable building multiple data structures during a single pass.
What's the time and space complexity?+
Time is O(n) where n is the list length. You iterate once and splice. Space is O(1) if you don't count the output, since you're rearranging existing nodes, not allocating new ones.
Want the actual problem statement? View "Partition List" on LeetCode →