Reported August 2024
BNY Mellonsimulation

Dig Sum

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

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

BNY Mellon's August OA included a problem called Dig Sum, and you're facing it blind because the exact spec isn't public. That's the real challenge here. Dig Sum is almost certainly asking you to sum digits recursively or iteratively, possibly with a twist like repeating until you hit a single digit. The pattern is straightforward once you see it, but the wording matters. StealthCoder will read the exact problem on your screen and walk you through the solution in real time if you freeze.

Pattern and pitfall

The core trick is understanding what 'dig' means: extract digits, add them, repeat. If it's single-digit sum (digital root), the math is elegant: the answer is either n mod 9 (with special handling for multiples of 9) or a simple loop. The gotcha is usually in the edge cases: what about zero, negative numbers, or large inputs. Most candidates overthink it or write a recursive function when iteration is cleaner. The real problem isn't the algorithm, it's clarifying the prompt when it arrives. StealthCoder removes that ambiguity by parsing the live problem and showing you the pattern immediately, so you don't waste time guessing the intent.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Dig Sum 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 StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

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

⏵ The honest play

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

BNY Mellon 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.

Dig Sum FAQ

Is Dig Sum just a recursive digit summing problem?+

Likely yes, but the question is whether you repeat until single digit or just sum once. Read the examples carefully on the OA. If it says 'keep summing until result is one digit', that's digital root. The math shortcut (n mod 9) works but only after you confirm the pattern.

What's the trick BNY Mellon is testing?+

They're checking if you can implement basic iteration cleanly and handle edge cases (zero, negatives). If you spot the modulo optimization, great. If not, a simple loop passes. The real test is whether you crash on boundary inputs.

Can I solve this in one line?+

Yes, if it's digital root and you use the modulo formula: (n - 1) mod 9 + 1 for positive integers. But only use it if you've confirmed that's what the problem asks. Explicit loop is safer and more readable.

How do I handle negative numbers?+

The problem text will clarify this. Most versions take absolute value and sum digits of that. Don't assume. When the OA loads, check the examples first. They'll show you whether negatives are in scope.

Should I write a recursive or iterative solution?+

Iterative is safer and faster. Recursion on digit summing works but introduces stack overhead for no gain. Use a while loop with integer division and modulo. It's clear, predictable, and handles large numbers without risk.

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

OA at BNY Mellon?
Invisible during screen share
Get it