MEDIUMasked at 33 companies

Min Stack

A medium-tier problem at 56% community acceptance, tagged with Stack, Design. Reported in interviews at Delhivery and 32 others.

Founder's read

Min Stack hits your assessment and you freeze. You know how to push and pop, but tracking the minimum in constant time without extra space isn't obvious. Companies like Snap, Nike, and Paytm ask this regularly. The problem feels like it should be simple, and that's the trap. You either solve it cleanly or you don't. The acceptance rate sits at 56%, which means half the candidates in the room are getting it wrong. If you blank on the trick during your live OA, StealthCoder solves it in seconds, invisible to the proctor.

Companies asking
33
Difficulty
MEDIUM
Acceptance
56%

Companies that ask "Min Stack"

If this hits your live OA

Min Stack 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 a senior engineer who knows the OA is theater. This is the script.

Get StealthCoder
What this means

The naive approach fails immediately: you can't pop the min in O(1) without storing history, and a separate min-tracking variable breaks when you pop the current minimum. The trick is storing pairs. Every element on the stack holds the value and the minimum at that point in time. On push, you compare the new value against the current min and store the smaller one. On pop, you restore the previous minimum from the pair you just removed. No extra stack needed, no space penalty, all operations land in O(1). The pattern is counterintuitive enough that most candidates either overthink it or reach for a second data structure. If this problem surfaces during your live assessment and the pattern doesn't click, StealthCoder runs invisibly and surfaces the working solution.

Pattern tags

The honest play

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

Min Stack 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. Built by a senior engineer who knows the OA is theater. This is the script. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Min Stack interview FAQ

Is Min Stack still actually asked at big companies?+

Yes. Snap, Nike, and Paytm have all asked it. The problem appears across 33 reported companies. It's a classic stack design question that doesn't trend away. Expect it especially at companies with backend or systems interview tracks.

Can you use two stacks to solve this?+

Yes, but it's not the intended solution and wastes space. Store each value on one stack and its corresponding minimum on another. It works, runs in O(1), but uses 2x memory. The pair approach is cleaner and what interviewers want to see.

What's the gotcha that trips people up?+

Assuming you can track the min as a single variable. When you pop the minimum value itself, you lose the old minimum. Candidates either build a second stack or try to store the min separately and fail on the pop operation. The pair pattern solves it, but you have to think in terms of history, not current state.

Does this relate to other stack design problems?+

Yes. The pattern of storing metadata alongside values appears in problems like validate parentheses, asteroid collision, and monotonic stack questions. Min Stack teaches you to think about what context you need to carry through each operation, not just the value itself.

How hard is this really for a medium problem?+

It's a medium that feels hard if you don't know the trick, easy if you do. The acceptance rate of 56% confirms it. Once you see the pair pattern once, it clicks forever. The risk is hitting it cold in your OA and burning minutes on an inefficient approach.

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