MEDIUMasked at 1 company

Maximum Twin Sum of a Linked List

A medium-tier problem at 81% community acceptance, tagged with Linked List, Two Pointers, Stack. Reported in interviews at josh technology and 0 others.

Founder's read

Maximum Twin Sum of a Linked List is a medium-difficulty linked list problem with an 81% acceptance rate, but don't let that fool you into underestimating the two-pointer pattern it tests. You're given a linked list, and you need to find the maximum sum of two nodes equidistant from the head and tail. Josh Technology has asked this one. The trick isn't sorting or extra space if you're clever; it's finding the midpoint, reversing the second half, and walking pointers simultaneously. If you hit this on your assessment and the pattern doesn't click immediately, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
1
Difficulty
MEDIUM
Acceptance
81%

Companies that ask "Maximum Twin Sum of a Linked List"

If this hits your live OA

Maximum Twin Sum of a Linked 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 by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The naive approach fails because you don't have random access to a linked list. Many candidates try to traverse twice to find all pairs, or they materialize the entire list into an array. The real pattern: use the slow/fast pointer technique to find the midpoint, reverse the second half in place, then iterate two pointers from head and reversed-tail inward, computing sums along the way. The second half reversal is the insight most people miss on first attempt. When you're live on the assessment and you blank on whether to reverse or use a stack, StealthCoder handles it. The acceptance rate is high because once you know the pattern, it's mechanical. The difficulty comes from keeping the logic clean under pressure.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Maximum Twin Sum of a Linked 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 by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Twin Sum of a Linked List interview FAQ

Is this really just two pointers and stack, or is there a sorting trick?+

No sorting needed. The stack and two-pointer approaches both work: stack stores the first half, pops while comparing with the second half. Two-pointer is cleaner: find midpoint with slow/fast, reverse the second half, then walk inward. Both are O(n) time. The two-pointer version is what most strong interviewers expect.

How do I find the midpoint without knowing the length?+

Slow and fast pointers. Slow moves one step, fast moves two steps. When fast reaches the end, slow is at the midpoint. This is standard linked list technique and gets tested repeatedly in medium problems. Practice it until it's muscle memory.

Do I need to restore the list to its original state after reversing?+

Depends on the problem statement. Most versions don't require restoration. Check the exact wording. If you're unsure during your assessment, ask. If you can't, assume you don't need to restore and code for maximum clarity and speed.

Josh Technology asked this. Does that mean it's a strong signal if I get it right?+

Yes. Josh Technology is the only company in the data for this problem. Getting it right shows you understand linked list manipulation under pressure. It's a solid foundational problem for roles that care about data structures.

What's the most common mistake on the live assessment?+

Off-by-one errors in the midpoint calculation and forgetting to handle odd-length lists correctly. Also, people reverse the second half correctly but then miscalculate which node to pair with which. Trace through a 5-node example on paper before you code.

Want the actual problem statement? View "Maximum Twin Sum of a Linked List" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.