Reported September 2024
JP Morgan

Maximum Amount

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

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

JP Morgan's September OA threw this one at candidates: maximize some quantity given constraints. No problem text survives the filter, but the title alone signals a classic optimization trap. You're looking at a problem where the naive greedy path will cost you points. StealthCoder acts as your safety net if the pattern doesn't click in real time during the assessment, letting you see the solution path without breaking your screen share.

Pattern and pitfall

Without the full problem text, the pattern is likely dynamic programming, greedy, or math-based. 'Maximum amount' problems at JP Morgan typically hinge on recognizing whether you can solve it top-down (DP with memoization) or if there's a closed-form insight that sidesteps iteration altogether. The common failure is trying to brute-force every combination. The real trick is identifying the constraint that lets you prune the search space or find an invariant. If it's a sequence or resource allocation problem, prefix sums or sliding windows might apply. During your live OA, if you blank on the recurrence or the greedy choice property, StealthCoder feeds you the pattern instantly so you can code with confidence.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Maximum Amount 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 for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

JP Morgan reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Amount FAQ

How hard is 'Maximum Amount' really?+

Medium to medium-hard. It's not a graph or tree nightmare, but it punishes incomplete DP setup or missed greedy insight. JP Morgan likes problems that test whether you think before coding. If you spot the pattern, it's 15-20 minutes. If you don't, you'll rewrite twice.

Is this a DP problem or greedy?+

Without the full text, both are possible. DP is safer if state transitions are clear. Greedy works if you can prove the greedy choice is always optimal. Test your greedy choice on small examples first. If it breaks, switch to DP.

What's the trick JP Morgan usually hides in 'maximum' problems?+

Either a constraint that makes brute force impossible (forcing DP/memoization), or a mathematical property that lets you skip iteration entirely. Read the constraints twice. Off-by-one bugs and overflow are common when you try to optimize prematurely.

Can I solve this in 48 hours if I haven't prepped?+

Yes, if you're solid on DP recurrence relations or can recognize greedy invariants. Review the DP template (define state, transition, base case) and one greedy proof example. That's enough to pattern-match during the OA.

What language should I code this in?+

Whatever you're fastest in. JP Morgan's OA typically supports Python, Java, C++, JavaScript. Python is fastest to prototype and debug. Stick with it unless you're fluent in another.

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

OA at JP Morgan?
Invisible during screen share
Get it