Reported September 2024
Ciscosimulation

Add Numbers

Reported by candidates from Cisco's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Cisco OA. Under 2s to a working solution.
Founder's read

Cisco asked this in September 2024, and it's a classic that still catches candidates off guard. You're adding two numbers, but the catch is almost always in the representation: they're stored as linked lists, strings, or digit arrays, and you can't just convert them to integers. It's a pattern recognition problem wrapped in a gotcha. StealthCoder will spot the representation trick and feed you the solution in real time if you freeze on the live OA.

Pattern and pitfall

The core pattern is simulation with careful carry management. You iterate through both inputs simultaneously, accumulate the sum at each position, track the carry, and build the result. The twist depends on input format. Linked list version: traverse both lists in parallel, create new nodes for the result, handle different lengths by treating missing nodes as zero. String or array version: same logic, just index from the right. Common pitfall: forgetting the final carry after one list ends, or mishandling lists of different lengths. Edge cases kill this one: both empty, single digit, all carries. The algorithm is O(max(m,n)) time and O(result length) space. Know the carry pattern cold before you walk in.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

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 passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as add two numbers. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Cisco's OA.

Cisco reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Add Numbers FAQ

Is this problem still asked at Cisco in 2024?+

Yes. Reported September 2024. It's a foundational problem that never ages out. Expect it as a warm-up or first problem in the OA, which makes the stakes even higher if you blank on carry logic.

What's the trick that makes candidates fail?+

The carry. You finish iterating both inputs and forget there's still a carry left. Also, many candidates write the result in reverse order without realizing it and don't reverse it back. Test with 999 + 1 = 1000 to catch this.

Should I code it iteratively or recursively?+

Iterative. It's cleaner, faster, and less error-prone under time pressure. Recursive works but adds stack overhead and makes carry threading annoying. Stick with a while loop and a carry variable.

How long should this take to code?+

5-8 minutes to write clean code with no bugs. If you know the pattern, it's muscle memory. If you're second-guessing carry logic live, you'll blow 20+ minutes. That's why running through it once before the OA matters.

What languages work best for this problem?+

Any. Python and Java are most common in OAs. Python's cleaner syntax for list operations helps. C++ and Go work fine. The algorithm doesn't change. Pick the language you've practiced with most.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Cisco.

OA at Cisco?
Invisible during screen share
Get it