Reported June 2025
JP Morgan

Find Total Weight

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 June OA is asking candidates to solve a weight calculation problem with minimal context. You don't have the full problem statement here, but the title alone tells you this is likely a tree traversal, graph traversal, or aggregation problem disguised as math. The OA is theater. StealthCoder runs invisible during your live attempt, reads the exact problem, and gives you the pattern instantly if you blank on the structure.

Pattern and pitfall

Without the full problem text, the pattern could be tree-based (summing weights across nodes), graph-based (accumulating edge weights), or array-based (aggregating weighted values). The trick is usually one of three things: figuring out whether you traverse depth-first or breadth-first, handling duplicate or overlapping weight sources, or optimizing beyond a naive summation. Most candidates overthink the traversal strategy and miss early-exit opportunities. When you hit the OA, focus on the input structure first. Is it a tree, a graph with cycles, or a list. Then build your traversal accordingly. StealthCoder watches the problem appear and immediately flags whether you need recursion, iteration, or memoization to avoid recalculating weights.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Find Total Weight 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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

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. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Find Total Weight FAQ

Is this a tree or graph problem?+

Without seeing the full problem, you can't know yet. When the OA loads, check the input format. If you see parent-child relationships and no cycles, it's a tree and you'll use DFS or BFS. If cycles are possible, it's a graph and you may need visited tracking or topological sorting.

What's the most common pitfall JP Morgan candidates hit on weight problems?+

Counting the same weight twice when nodes or edges overlap. Read the problem carefully. Does each weight apply once per object, or once globally. Test your logic on the example before submitting.

Do I need dynamic programming for this?+

Unlikely. Weight aggregation is usually a single pass. You'd only need memoization if the problem asks for multiple queries on the same structure, or if recalculating subtree weights becomes expensive. Start simple, optimize if you timeout.

How do I prepare in 48 hours if I've never seen the problem?+

Review tree traversal (DFS, BFS), graph traversal with visited sets, and basic array summation. Know how to parse adjacency lists and parent pointers. That covers 90 percent of weight problems. Code one tree DFS and one graph BFS from scratch.

Is this a trick question about integer overflow or precision?+

Possibly, if the weights are large or the tree is deep. Check the constraints when you see them. Use a 64-bit integer type if available. JP Morgan sometimes tests whether you catch edge cases, so don't assume the happy path is the only one.

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