House Robber II
A medium-tier problem at 44% community acceptance, tagged with Array, Dynamic Programming. Reported in interviews at Nordstrom and 9 others.
House Robber II is asked at Nordstrom, Databricks, thoughtspot, PhonePe, Docusign, ByteDance, Datadog, Visa, LinkedIn, and TikTok. It looks like a standard dynamic programming problem until you realize the twist: houses form a circle, so robbing the first house blocks the last one. Acceptance sits at 43.5%, which means solid DP candidates still get tripped up. The trick isn't complex, but missing it during a live assessment costs you. If you blank on how to handle the circular constraint, StealthCoder runs invisibly and surfaces a working solution in seconds.
Companies that ask "House Robber II"
House Robber II 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.
Get StealthCoderThe naive DP approach works fine for a line of houses, but here the circular layout creates a dependency: you cannot rob both house 0 and house n-1. The standard move is to run DP twice: once excluding the last house, once excluding the first, then return the max. Most candidates grasp the DP transition (rob current or skip it) but fail to recognize the circular constraint on the problem read. You'll see people try to patch a linear solution mid-interview and get tangled in edge cases. This is exactly where you hit a wall in the OA and need clarity fast. StealthCoder handles the split-case logic and lets you code with confidence instead of debugging intuition.
Pattern tags
You know the problem.
Make sure you actually pass it.
House Robber II 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. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.
House Robber II interview FAQ
Is House Robber II actually harder than House Robber I?+
Not mechanically harder, but conceptually trickier. The DP state machine is identical, Array and Dynamic Programming. The catch is the circular constraint. Candidates who skip that detail waste 10-15 minutes backtracking. Acceptance rate of 43.5% reflects this gotcha tax, not algorithmic depth.
Do FAANG companies still ask this?+
Yes. LinkedIn, ByteDance, and TikTok have all reported it. It's a proven filter: it catches people who memorize DP templates without thinking about problem structure. Expect it in phone screens and online assessments.
What's the key insight I'm missing?+
The circular constraint breaks linear DP. Solution: run two DP passes, one excluding house 0, one excluding house n-1. Take the max result. It's simple once you see it, but the insight doesn't appear in the problem statement. That's the trap.
How does this relate to Array and Dynamic Programming topics?+
It's a classic DP on Array problem that teaches constraint propagation. Linear DP is standard; circular DP forces you to think about dependencies and boundary conditions. Companies use it to separate candidates who pattern-match from those who read carefully.
What edge cases crash most solutions?+
Arrays with 1 or 2 houses. If you don't handle those before the two-pass logic, your code breaks. Also, don't forget that skipping a house entirely (robbing 0 houses) is valid. These details trip up fast coders who think they've solved it.
Want the actual problem statement? View "House Robber II" on LeetCode →