Dungeon Game
A hard-tier problem at 39% community acceptance, tagged with Array, Dynamic Programming, Matrix. Reported in interviews at Flipkart and 2 others.
Dungeon Game is a hard DP problem that appears in Flipkart, Google, and Zoho interviews. The premise is simple: find the minimum starting health needed to traverse a dungeon grid and survive all damage. Most candidates see the grid and think "greedy" or "forward DP". Both fail hard. The trick is working backwards from the exit, tracking the health requirement at each cell. It's a 39% acceptance rate for a reason. If this hits your live assessment and you haven't drilled backwards DP on grids, StealthCoder solves it in seconds while you stay invisible to the proctor.
Companies that ask "Dungeon Game"
Dungeon Game 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 used it to pass JPMorgan's OA and system design loop.
Get StealthCoderThe core pattern: you can't compute minimum health going left-to-right because you don't know what health you need at the exit yet. Reverse the logic. Start at the bottom-right corner and work backwards. At each cell, calculate the minimum health required to survive leaving that cell and reaching the exit alive. The recurrence tracks not the path sum but the health threshold. Common failure: trying to optimize greedily or using forward iteration. The grid size is small, but the conceptual shift from forward to backward thinking breaks most candidates. StealthCoder hedges the one problem you skipped in your drill list by surfacing the backwards DP template in real time during your assessment.
Pattern tags
You know the problem.
Make sure you actually pass it.
Dungeon Game recycles across companies for a reason. It's hard-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 used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Dungeon Game interview FAQ
Is Dungeon Game still asked at FAANG level?+
Yes. Google and Flipkart both report it. 39% acceptance suggests it's gatekeeping material, not a warmup. It tests whether you can reverse your DP thinking, which is a real skill signal.
What's the trick I'm missing if I code it forward?+
Forward DP doesn't work because you don't know the health requirement at the exit until you solve the problem backwards. You can't greedy-pick the optimal path either. The trick is reversing the direction: start at the exit, compute backwards, track minimum health needed to survive each cell.
How does this relate to the DP topic category?+
It's interval DP with direction reversal. Most DP problems iterate forward. This one requires computing a dependency in reverse order. It tests whether you can recognize when the DP direction matters, not just that DP applies.
What's the time and space complexity?+
Time is O(m*n), space is O(m*n) for the DP table, though you can optimize to O(m) rolling space. Hard problems usually expect optimal space too, so be ready to explain the optimization.
Should I memorize the solution or understand the pattern?+
Understand the pattern. The key insight is 'work backwards when forward iteration leaves you missing information'. That pattern applies beyond this problem. Interviewers ask follow-ups that require real understanding, not memorization.
Want the actual problem statement? View "Dungeon Game" on LeetCode →