HARDasked at 4 companies

Painting the Walls

A hard-tier problem at 49% community acceptance, tagged with Array, Dynamic Programming. Reported in interviews at Snowflake and 3 others.

Founder's read

Painting the Walls is a hard DP problem that sits in the acceptance sweet spot: just under 49% pass rate, which means it's hard enough to trip up half the room but not a pure nightmare. Snowflake, Media.net, DE Shaw, and Meesho have all asked it. The problem looks deceptively simple on first read, but the state space is wider than it appears. Most candidates either brute-force a solution that times out or miss the optimization that makes it solvable. If this problem hits your live assessment and you blank on the DP formulation, StealthCoder solves it in seconds, invisible to the proctor.

Companies asking
4
Difficulty
HARD
Acceptance
49%

Companies that ask "Painting the Walls"

If this hits your live OA

Painting the Walls 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 StealthCoder
What this means

Painting the Walls is a state-machine DP disguised as a greedy problem. You need to track not just what's been painted, but how many free days you've earned and what actions are available at each step. The trap: trying to solve it with a simple one-dimensional DP on walls. The fix: expand your state to account for both progress and constraints. Most solutions that time out haven't pruned redundant states or missed a key mathematical insight about cost scaling. Array iteration is straightforward, but the DP transition is where the problem hides. When you're stuck during the live OA and can't find the right state definition, StealthCoder surfaces a working solution that passes all test cases.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Painting the Walls 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. 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.

Painting the Walls interview FAQ

Is this really as hard as it's labeled?+

Yes. The 49% acceptance rate backs it up. The problem is marked hard and the acceptance reflects that. Most people who attempt it don't pass. It's not a trick-based easy-labeled-hard problem; it's a genuine algorithmic challenge that requires solid DP reasoning.

What's the main DP trick here?+

You need to track two dimensions: walls painted and free days accumulated. The state can't be just 'walls done.' Many candidates try a greedy approach first and it fails. The DP must capture both resource constraints and available actions at each step.

Do I need both Array and Dynamic Programming skills?+

Array is your iteration foundation, but DP is the core. You're building a table and exploring transitions between states. Array knowledge keeps your code clean and fast. DP is where the solution lives.

Have major companies stopped asking this?+

No. Snowflake, Media.net, DE Shaw, and Meesho have all asked it recently enough to be in the data. It's still in rotation, especially at quant and systems-heavy shops that care about optimization.

What's the biggest pitfall on the live OA?+

Timeout on large inputs because you didn't optimize the state space or forgot to memoize. Also common: wrong state definition that makes transitions impossible to reason about. The algorithmic insight is non-obvious, which is why the acceptance rate is so low.

Want the actual problem statement? View "Painting the Walls" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.