Python data engineering interview problem. Difficulty: advanced. Pattern: Dynamic Programming. About 18 minutes. Part of the Pro drill bank.
Max money robbing non-adjacent houses. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement rob(nums: list) -> int. (1+3).
Input: rob([1, 2, 3, 1]) Output: 4 Rob house 1 and 3.
Topics: lakebench, python, dp, house robber.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Max money robbing non-adjacent houses.
Implement `rob(nums: list) -> int`. Example: `[1, 2, 3, 1]` → `4` (1+3). Keep the harness.