Add Numbers
Reported by candidates from Oracle's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Oracle asked this in February. Add Numbers sounds simple until you realize you're probably working with linked lists or big integers that won't fit in standard types. You're not actually adding two numbers in the conventional sense. The OA is checking if you can handle list traversal, carry logic, and edge cases like mismatched lengths or leading zeros. StealthCoder reads the exact problem format when you're live and surfaces the pattern in real time if you freeze on the approach.
Pattern and pitfall
The trick here is almost always linked list addition from the tail forward. You traverse both lists simultaneously, handle carry at each node, and build a new result list. The pitfall: candidates forget that lists can have different lengths, or they try to reverse when reversal isn't needed (or is needed, depending on the variant). If it's big integer strings instead, you're doing digit-by-digit addition with string indexing and carry propagation. Either way, the pattern is mechanical once you see it. If you blank on the exact node-linking syntax, StealthCoder feeds it back during the OA so you don't waste interview time on boilerplate.
If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.
You can drill Add Numbers cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as add two numbers. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Oracle's OA.
Oracle reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Add Numbers FAQ
Is this a linked list problem or a math problem?+
It's both. You're adding numbers, but the input format (usually linked lists) forces you to think about traversal and carry logic. If it's string input, it's a digit-by-digit simulation. Either way, the core is managing carry state as you step through the input.
What's the common mistake on this one?+
Forgetting to handle the final carry after the main loop ends. If you add 99 + 1, the carry propagates beyond both input lists, and you need a new node. Also, mismatched list lengths trip people up if they don't iterate to the end of both.
Can I solve this in one pass?+
Yes. Iterate through both lists simultaneously, accumulate carry, and append result nodes as you go. Don't reverse anything unless the problem specifies list order. One pass is expected.
How do I prepare for this in 48 hours?+
Know linked list node creation and traversal cold. Practice the carry loop on paper once. Trace through one example with different lengths and one with final carry. That's it. The pattern is simple; execution speed is what counts.
Is this still a common OA question?+
Yes, Oracle and similar companies still ask it. It's a reliable signal of whether you can code carefully under pressure. Expect it or something similar.