Monotonic Stack problems,
and the tell.
You need the next or previous element that is greater or smaller, for every position. 38 problems in the catalogue carry this tag, from first-week easy to interview hard.
Free to start. Running and submitting a solution never costs credits.
How the pattern actually works.
One mechanism, and the mistake that costs people the problem.
The tell. You need the next or previous element that is greater or smaller, for every position.
The mechanism. Keep a stack that only ever rises or only ever falls. Each new element pops the ones it answers, so every element is pushed and popped once and the whole scan is linear.
What goes wrong. Picking the wrong direction. Next greater needs a decreasing stack, and the mirror image for the other three variants.
The ones asked most often.
By how often the catalogue records them being set, not by our opinion.
- Number of Visible People in a QueueHardasked at 6 companies
- Smallest K-Length Subsequence With Occurrences of a LetterHardasked at 1 companies
- Final Prices With a Special Discount in a ShopEasyasked at 0 companies
- Number of Valid SubarraysHardasked at 1 companies
- Online Stock SpanMediumasked at 1 companies
- Shortest Unsorted Continuous SubarrayMediumasked at 1 companies
- Maximum Array Hopping Score IMediumasked at 1 companies
- Maximum Array Hopping Score IIMediumasked at 1 companies
- Subarray With Elements Greater Than Varying ThresholdHardasked at 1 companies
- Find Building Where Alice and Bob Can MeetHardasked at 1 companies
Read it, watch it, then solve it.
The order that makes a pattern stick.
Everything in the app, in one place.
Practice, interviews and the tools, all free to start. Swipe to see the rest.
DSA practice
Problems filed under the pattern that solves them, not a sheet.
352 problemsOpenCompany sets
Practise what one company actually asks, the week before the round.
463 companiesOpenCoding interview
Pick the role, write in a real editor, and answer while you type.
scored reportOpenMock interviews, spoken
You answer out loud, it follows up on what you said.
36 topicsOpenDatabase round
DBMS asked the way a panel asks it: indexes, joins, normal forms.
in Core CSOpenOOP round
Inheritance, polymorphism and the follow-up you never rehearse.
in Core CSOpenSystem design
How real systems are built, from the primitives to the AI stack.
27 chaptersOpenSQL practice
Real schemas, your query, the rows it returns, and an honest verdict.
39 questionsOpenAptitude
Quant, logical, verbal, DI and technical, timed like the real test.
280 questionsOpenOnline assessment
A clock, marks per question and hidden tests, like a company's judge.
37 papersOpenAlgorithm visualiser
Watch it run on your own input, one step at a time.
26 algorithmsOpenAI that helps, not solves
Hints one at a time, AI review before a mentor reads it.
100 free creditsOpenResume builder
Build it inside the app, next to the work you practised.
in the appOpenProgress and readiness
One score, and the axis you are weakest on.
tracked dailyOpen
Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app
About monotonic stack problems.
Free to start, no card.
Start practisingHow do I know a problem is a monotonic stack problem?
You need the next or previous element that is greater or smaller, for every position.
How many monotonic stack problems should I solve?
Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 38, split roughly 2 easy, 25 medium and 11 hard in the sample we show, so work up rather than across.
What goes wrong most often in monotonic stack problems?
Picking the wrong direction. Next greater needs a decreasing stack, and the mirror image for the other three variants.
Is practising by pattern better than a problem sheet?
A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.