EASYasked at 2 companies

Min Cost Climbing Stairs

A easy-tier problem at 67% community acceptance, tagged with Array, Dynamic Programming. Reported in interviews at Amazon and 1 others.

Founder's read

Min Cost Climbing Stairs shows up in Amazon and Accenture assessments, and 67% of candidates pass it, but that doesn't mean you won't blank on the state transition when you're live. The trap is treating it like a simple recursion problem when the real trick is recognizing that you only need to track the last two steps to make an optimal choice at each position. If you hit this during your online assessment and the recurrence relation isn't clicking, StealthCoder surfaces the DP setup in seconds while the proctor sees nothing.

Companies asking
2
Difficulty
EASY
Acceptance
67%

Companies that ask "Min Cost Climbing Stairs"

If this hits your live OA

Min Cost Climbing Stairs 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 StealthCoder
What this means

The problem looks straightforward: climb a staircase, minimize cost. Candidates often start with a recursive approach (brute force all paths), then watch it TLE. The insight is that your cost at any step is the minimum of arriving from the previous step or the step before that, plus the current cost. This is textbook bottom-up DP, but the gotcha is the initial state: you can start at step 0 or step 1, so you have to seed correctly. Most misses come from off-by-one errors in the loop bounds or failing to recognize that you're not actually climbing to a peak but to or past the last step. When you're under pressure in the assessment, StealthCoder is the safety net if you get tangled in the state representation.

Pattern tags

The honest play

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

Min Cost Climbing Stairs recycles across companies for a reason. It's easy-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.

Min Cost Climbing Stairs interview FAQ

Is this actually asked at Amazon and Accenture in their OAs?+

Yes. Both companies report it in their assessment rotations. It's an easy-difficulty problem with a 67% acceptance rate, so it's not a gimmick question, but it's also not a gimme if you haven't seen the DP pattern before. You'll likely see it or something nearly identical.

Can you solve this with just recursion plus memoization or do you need true DP?+

Both work. Top-down recursion with memoization and bottom-up DP both pass. Bottom-up is cleaner because you don't risk stack overflow and the recurrence is trivial to implement once you nail the loop invariant. Either approach will pass in the assessment.

What's the actual trick people miss?+

The starting state. You can start at step 0 or step 1, and you need to reach the last step or beyond. Candidates often hard-code the wrong initial conditions or loop over the wrong range. Getting those two lines right eliminates 90% of submissions that fail.

How does this relate to other Dynamic Programming problems I should know?+

It's a foundational DP problem. The pattern is identical to Fibonacci (two-state recurrence, no dependencies beyond the previous two values), so if you can nail the recurrence here you can apply it to climbing variants, house robber, and similar problems. Master this, scale up.

What languages is this typically asked in during assessments?+

Any. Python, Java, C++, Go, JavaScript all appear in Amazon and Accenture assessments. The algorithm is language-agnostic, so pick whichever you're fastest in. The bottleneck is the logic, not the syntax.

Want the actual problem statement? View "Min Cost Climbing Stairs" 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.