# Monotonic Stack DSA Problems

> 67 Monotonic Stack coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/monotonic-stack
Last updated: 2026-11-28

67 monotonic stack problems for coding interviews and campus placements, with hints and company tags. Below are all 67: 2 easy, 42 medium and 23 hard. Practise them free on InternHack and track what you have solved.

## Monotonic Stack problems, easiest first

1. [Final Prices With a Special Discount in a Shop](https://www.internhack.in/learn/dsa/problem/final-prices-with-a-special-discount-in-a-shop) (Easy)
2. [Next Greater Element I](https://www.internhack.in/learn/dsa/problem/next-greater-element-i) (Easy)
3. [132 Pattern](https://www.internhack.in/learn/dsa/problem/132-pattern) (Medium)
4. [Beautiful Towers I](https://www.internhack.in/learn/dsa/problem/beautiful-towers-i) (Medium)
5. [Beautiful Towers II](https://www.internhack.in/learn/dsa/problem/beautiful-towers-ii) (Medium)
6. [Binary Searchable Numbers in an Unsorted Array](https://www.internhack.in/learn/dsa/problem/binary-searchable-numbers-in-an-unsorted-array) (Medium)
7. [Buildings With an Ocean View](https://www.internhack.in/learn/dsa/problem/buildings-with-an-ocean-view) (Medium)
8. [Car Fleet](https://www.internhack.in/learn/dsa/problem/car-fleet) (Medium)
9. [Construct Binary Search Tree from Preorder Traversal](https://www.internhack.in/learn/dsa/problem/construct-binary-search-tree-from-preorder-traversal) (Medium)
10. [Count Bowl Subarrays](https://www.internhack.in/learn/dsa/problem/count-bowl-subarrays) (Medium)
11. [Count Submatrices With All Ones](https://www.internhack.in/learn/dsa/problem/count-submatrices-with-all-ones) (Medium)
12. [Daily Temperatures](https://www.internhack.in/learn/dsa/problem/daily-temperatures) (Medium)
13. [Find the Most Competitive Subsequence](https://www.internhack.in/learn/dsa/problem/find-the-most-competitive-subsequence) (Medium)
14. [Finding the Number of Visible Mountains](https://www.internhack.in/learn/dsa/problem/finding-the-number-of-visible-mountains) (Medium)
15. [Jump Game VIII](https://www.internhack.in/learn/dsa/problem/jump-game-viii) (Medium)
16. [Longest Well-Performing Interval](https://www.internhack.in/learn/dsa/problem/longest-well-performing-interval) (Medium)
17. [Make Array Non-decreasing](https://www.internhack.in/learn/dsa/problem/make-array-non-decreasing) (Medium)
18. [Max Chunks To Make Sorted](https://www.internhack.in/learn/dsa/problem/max-chunks-to-make-sorted) (Medium)
19. [Maximal Range That Each Element Is Maximum in It](https://www.internhack.in/learn/dsa/problem/maximal-range-that-each-element-is-maximum-in-it) (Medium)
20. [Maximum Array Hopping Score I](https://www.internhack.in/learn/dsa/problem/maximum-array-hopping-score-i) (Medium)
21. [Maximum Array Hopping Score II](https://www.internhack.in/learn/dsa/problem/maximum-array-hopping-score-ii) (Medium)
22. [Maximum Balanced Shipments](https://www.internhack.in/learn/dsa/problem/maximum-balanced-shipments) (Medium)
23. [Maximum Binary Tree](https://www.internhack.in/learn/dsa/problem/maximum-binary-tree) (Medium)
24. [Maximum Length of Semi-Decreasing Subarrays](https://www.internhack.in/learn/dsa/problem/maximum-length-of-semi-decreasing-subarrays) (Medium)
25. [Maximum of Minimum Values in All Subarrays](https://www.internhack.in/learn/dsa/problem/maximum-of-minimum-values-in-all-subarrays) (Medium)
26. [Maximum Subarray Min-Product](https://www.internhack.in/learn/dsa/problem/maximum-subarray-min-product) (Medium)
27. [Maximum Width Ramp](https://www.internhack.in/learn/dsa/problem/maximum-width-ramp) (Medium)
28. [Minimum Cost Tree From Leaf Values](https://www.internhack.in/learn/dsa/problem/minimum-cost-tree-from-leaf-values) (Medium)
29. [Minimum Operations to Convert All Elements to Zero](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-convert-all-elements-to-zero) (Medium)
30. [Next Greater Element II](https://www.internhack.in/learn/dsa/problem/next-greater-element-ii) (Medium)
31. [Next Greater Node In Linked List](https://www.internhack.in/learn/dsa/problem/next-greater-node-in-linked-list) (Medium)
32. [Number of People That Can Be Seen in a Grid](https://www.internhack.in/learn/dsa/problem/number-of-people-that-can-be-seen-in-a-grid) (Medium)
33. [Online Stock Span](https://www.internhack.in/learn/dsa/problem/online-stock-span) (Medium)
34. [Remove Duplicate Letters](https://www.internhack.in/learn/dsa/problem/remove-duplicate-letters) (Medium)
35. [Remove K Digits](https://www.internhack.in/learn/dsa/problem/remove-k-digits) (Medium)
36. [Remove Nodes From Linked List](https://www.internhack.in/learn/dsa/problem/remove-nodes-from-linked-list) (Medium)
37. [Shortest Subarray to be Removed to Make Array Sorted](https://www.internhack.in/learn/dsa/problem/shortest-subarray-to-be-removed-to-make-array-sorted) (Medium)
38. [Shortest Unsorted Continuous Subarray](https://www.internhack.in/learn/dsa/problem/shortest-unsorted-continuous-subarray) (Medium)
39. [Smallest Subsequence of Distinct Characters](https://www.internhack.in/learn/dsa/problem/smallest-subsequence-of-distinct-characters) (Medium)
40. [Steps to Make Array Non-decreasing](https://www.internhack.in/learn/dsa/problem/steps-to-make-array-non-decreasing) (Medium)
41. [Sum of Subarray Minimums](https://www.internhack.in/learn/dsa/problem/sum-of-subarray-minimums) (Medium)
42. [Sum of Subarray Ranges](https://www.internhack.in/learn/dsa/problem/sum-of-subarray-ranges) (Medium)
43. [The Number of Weak Characters in the Game](https://www.internhack.in/learn/dsa/problem/the-number-of-weak-characters-in-the-game) (Medium)
44. [Verify Preorder Sequence in Binary Search Tree](https://www.internhack.in/learn/dsa/problem/verify-preorder-sequence-in-binary-search-tree) (Medium)
45. [Apply Operations to Maximize Score](https://www.internhack.in/learn/dsa/problem/apply-operations-to-maximize-score) (Hard)
46. [Car Fleet II](https://www.internhack.in/learn/dsa/problem/car-fleet-ii) (Hard)
47. [Count Non-Decreasing Subarrays After K Operations](https://www.internhack.in/learn/dsa/problem/count-non-decreasing-subarrays-after-k-operations) (Hard)
48. [Create Maximum Number](https://www.internhack.in/learn/dsa/problem/create-maximum-number) (Hard)
49. [Find Building Where Alice and Bob Can Meet](https://www.internhack.in/learn/dsa/problem/find-building-where-alice-and-bob-can-meet) (Hard)
50. [Find Maximum Non-decreasing Array Length](https://www.internhack.in/learn/dsa/problem/find-maximum-non-decreasing-array-length) (Hard)
51. [Find the Number of Subarrays Where Boundary Elements Are Maximum](https://www.internhack.in/learn/dsa/problem/find-the-number-of-subarrays-where-boundary-elements-are-maximum) (Hard)
52. [Largest Rectangle in Histogram](https://www.internhack.in/learn/dsa/problem/largest-rectangle-in-histogram) (Hard)
53. [Lexicographically Smallest String After Deleting Duplicate Characters](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-string-after-deleting-duplicate-characters) (Hard)
54. [Max Chunks To Make Sorted II](https://www.internhack.in/learn/dsa/problem/max-chunks-to-make-sorted-ii) (Hard)
55. [Maximal Rectangle](https://www.internhack.in/learn/dsa/problem/maximal-rectangle) (Hard)
56. [Maximum Number of Books You Can Take](https://www.internhack.in/learn/dsa/problem/maximum-number-of-books-you-can-take) (Hard)
57. [Maximum Score of a Good Subarray](https://www.internhack.in/learn/dsa/problem/maximum-score-of-a-good-subarray) (Hard)
58. [Minimum Number of Increments on Subarrays to Form a Target Array](https://www.internhack.in/learn/dsa/problem/minimum-number-of-increments-on-subarrays-to-form-a-target-array) (Hard)
59. [Minimum Number of Visited Cells in a Grid](https://www.internhack.in/learn/dsa/problem/minimum-number-of-visited-cells-in-a-grid) (Hard)
60. [Minimum Operations to Make Array Equal to Target](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-array-equal-to-target) (Hard)
61. [Number of Valid Subarrays](https://www.internhack.in/learn/dsa/problem/number-of-valid-subarrays) (Hard)
62. [Number of Visible People in a Queue](https://www.internhack.in/learn/dsa/problem/number-of-visible-people-in-a-queue) (Hard)
63. [Odd Even Jump](https://www.internhack.in/learn/dsa/problem/odd-even-jump) (Hard)
64. [Smallest K-Length Subsequence With Occurrences of a Letter](https://www.internhack.in/learn/dsa/problem/smallest-k-length-subsequence-with-occurrences-of-a-letter) (Hard)
65. [Subarray With Elements Greater Than Varying Threshold](https://www.internhack.in/learn/dsa/problem/subarray-with-elements-greater-than-varying-threshold) (Hard)
66. [Sum of Total Strength of Wizards](https://www.internhack.in/learn/dsa/problem/sum-of-total-strength-of-wizards) (Hard)
67. [Trapping Rain Water](https://www.internhack.in/learn/dsa/problem/trapping-rain-water) (Hard)

## Companies that ask monotonic stack problems

- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 47 of these problems
- [Google](https://www.internhack.in/learn/dsa/companies/google): 47 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 31 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 30 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 29 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 19 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 10 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 9 of these problems
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs): 9 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 9 of these problems
- [Salesforce](https://www.internhack.in/learn/dsa/companies/salesforce): 9 of these problems
- [Flipkart](https://www.internhack.in/learn/dsa/companies/flipkart): 8 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
