Maximum Amount of Money Robot Can Earn
A medium-tier problem at 29% community acceptance, tagged with Array, Dynamic Programming, Matrix. Reported in interviews at PhonePe and 0 others.
PhonePe has asked this problem. It's a grid traversal game where a robot collects money across a matrix, and the trap is thinking greedily row-by-row or column-by-column. You need to track multiple paths simultaneously and understand that the optimal solution at step N depends on states you've already computed. With a 28.7% acceptance rate, candidates often miss the DP state definition or try a recursive brute force that times out. If this lands in your live assessment and you freeze on the recurrence, StealthCoder reads the grid and surfaces the working DP solution invisible to the proctor.
Companies that ask "Maximum Amount of Money Robot Can Earn"
Maximum Amount of Money Robot Can Earn is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoderThe core trick is recognizing that you can't decide locally. The robot's maximum earnings from any cell depend on the maximum it could have earned from multiple previous cells, and you need to track all viable paths in parallel. This is a 2D DP problem where the state isn't just position, but the value accumulated from the optimal path to that position. Common failures: trying a single greedy path (down or right), not realizing you need backward induction, or using recursion without memoization and hitting time limits. The matrix topic hints at the 2D grid structure; the array foundation means you'll be indexing carefully. Build your DP table bottom-up or use memoization top-down, but either way, you're computing cumulative maxima across overlapping subproblems. StealthCoder is your safety net if the state transitions feel murky during the real OA.
Pattern tags
You know the problem.
Make sure you actually pass it.
Maximum Amount of Money Robot Can Earn recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Maximum Amount of Money Robot Can Earn interview FAQ
Is this really just a standard path-sum problem?+
No. Standard path-sum lets you pick any cell on the way. This problem constrains movement and asks for maximum value collected, which forces you to think about competing paths and when to merge solutions. That constraint is why the acceptance rate sits at 28.7% instead of higher.
What's the DP state I should use?+
dp[i][j] typically represents the maximum money the robot can earn reaching cell (i, j). You compute it by considering all valid previous positions and taking the maximum. The exact transitions depend on the movement rules, so read the problem carefully.
Will recursion with memoization pass, or do I need bottom-up?+
Either can work, but bottom-up is safer on large grids. Recursion risks stack overflow or cache misses. Bottom-up guarantees linear iteration and is faster in practice. Pick bottom-up if you're unsure during the OA.
How does this relate to coin change or climbing stairs?+
All three are DP fundamentals. This one adds a 2D spatial component and simultaneous path tracking. Coin change is 1D knapsack; this is 2D path aggregation. If you're weak on coin change, drill that first.
What mistakes does PhonePe see most on this?+
Candidates often code a single path greedily, submit, and fail. Then they realize the robot can take multiple routes and try brute force recursion without memoization. Read the constraints carefully, memoize or tabulate, and test on small grids before submitting.
Want the actual problem statement? View "Maximum Amount of Money Robot Can Earn" on LeetCode →