# Dynamic Programming DSA Problems

> 557 Dynamic Programming 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/dynamic-programming
Last updated: 2026-11-28

557 dynamic programming problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 557: 13 easy, 0 medium and 87 hard. Practise them free on InternHack and track what you have solved.

## Dynamic Programming problems, easiest first

1. [Best Time to Buy and Sell Stock](https://www.internhack.in/learn/dsa/problem/best-time-to-buy-and-sell-stock) (Easy)
2. [Climbing Stairs](https://www.internhack.in/learn/dsa/problem/climbing-stairs) (Easy)
3. [Count Numbers With Unique Digits II](https://www.internhack.in/learn/dsa/problem/count-numbers-with-unique-digits-ii) (Easy)
4. [Counting Bits](https://www.internhack.in/learn/dsa/problem/counting-bits) (Easy)
5. [Divisor Game](https://www.internhack.in/learn/dsa/problem/divisor-game) (Easy)
6. [Fibonacci Number](https://www.internhack.in/learn/dsa/problem/fibonacci-number) (Easy)
7. [Is Subsequence](https://www.internhack.in/learn/dsa/problem/is-subsequence) (Easy)
8. [Longest Unequal Adjacent Groups Subsequence I](https://www.internhack.in/learn/dsa/problem/longest-unequal-adjacent-groups-subsequence-i) (Easy)
9. [Maximum Repeating Substring](https://www.internhack.in/learn/dsa/problem/maximum-repeating-substring) (Easy)
10. [Min Cost Climbing Stairs](https://www.internhack.in/learn/dsa/problem/min-cost-climbing-stairs) (Easy)
11. [N-th Tribonacci Number](https://www.internhack.in/learn/dsa/problem/n-th-tribonacci-number) (Easy)
12. [Pascal's Triangle](https://www.internhack.in/learn/dsa/problem/pascals-triangle) (Easy)
13. [Pascal's Triangle II](https://www.internhack.in/learn/dsa/problem/pascals-triangle-ii) (Easy)
14. [Check if There Is a Valid Parentheses String Path](https://www.internhack.in/learn/dsa/problem/check-if-there-is-a-valid-parentheses-string-path) (Hard)
15. [Allocate Mailboxes](https://www.internhack.in/learn/dsa/problem/allocate-mailboxes) (Hard)
16. [Arithmetic Slices II - Subsequence](https://www.internhack.in/learn/dsa/problem/arithmetic-slices-ii-subsequence) (Hard)
17. [Best Time to Buy and Sell Stock III](https://www.internhack.in/learn/dsa/problem/best-time-to-buy-and-sell-stock-iii) (Hard)
18. [Best Time to Buy and Sell Stock IV](https://www.internhack.in/learn/dsa/problem/best-time-to-buy-and-sell-stock-iv) (Hard)
19. [Binary Tree Cameras](https://www.internhack.in/learn/dsa/problem/binary-tree-cameras) (Hard)
20. [Binary Tree Maximum Path Sum](https://www.internhack.in/learn/dsa/problem/binary-tree-maximum-path-sum) (Hard)
21. [Build Array Where You Can Find The Maximum Exactly K Comparisons](https://www.internhack.in/learn/dsa/problem/build-array-where-you-can-find-the-maximum-exactly-k-comparisons) (Hard)
22. [Burst Balloons](https://www.internhack.in/learn/dsa/problem/burst-balloons) (Hard)
23. [Cat and Mouse](https://www.internhack.in/learn/dsa/problem/cat-and-mouse) (Hard)
24. [Cat and Mouse II](https://www.internhack.in/learn/dsa/problem/cat-and-mouse-ii) (Hard)
25. [Check if an Original String Exists Given Two Encoded Strings](https://www.internhack.in/learn/dsa/problem/check-if-an-original-string-exists-given-two-encoded-strings) (Hard)
26. [Cherry Pickup](https://www.internhack.in/learn/dsa/problem/cherry-pickup) (Hard)
27. [Cherry Pickup II](https://www.internhack.in/learn/dsa/problem/cherry-pickup-ii) (Hard)
28. [Choose Numbers From Two Arrays in Range](https://www.internhack.in/learn/dsa/problem/choose-numbers-from-two-arrays-in-range) (Hard)
29. [Closest Subsequence Sum](https://www.internhack.in/learn/dsa/problem/closest-subsequence-sum) (Hard)
30. [Coin Path](https://www.internhack.in/learn/dsa/problem/coin-path) (Hard)
31. [Concatenated Divisibility](https://www.internhack.in/learn/dsa/problem/concatenated-divisibility) (Hard)
32. [Concatenated Words](https://www.internhack.in/learn/dsa/problem/concatenated-words) (Hard)
33. [Constrained Subsequence Sum](https://www.internhack.in/learn/dsa/problem/constrained-subsequence-sum) (Hard)
34. [Construct String with Minimum Cost](https://www.internhack.in/learn/dsa/problem/construct-string-with-minimum-cost) (Hard)
35. [Count All Valid Pickup and Delivery Options](https://www.internhack.in/learn/dsa/problem/count-all-valid-pickup-and-delivery-options) (Hard)
36. [Count Different Palindromic Subsequences](https://www.internhack.in/learn/dsa/problem/count-different-palindromic-subsequences) (Hard)
37. [Count Fertile Pyramids in a Land](https://www.internhack.in/learn/dsa/problem/count-fertile-pyramids-in-a-land) (Hard)
38. [Count Increasing Quadruplets](https://www.internhack.in/learn/dsa/problem/count-increasing-quadruplets) (Hard)
39. [Count K-Reducible Numbers Less Than N](https://www.internhack.in/learn/dsa/problem/count-k-reducible-numbers-less-than-n) (Hard)
40. [Count Number of Balanced Permutations](https://www.internhack.in/learn/dsa/problem/count-number-of-balanced-permutations) (Hard)
41. [Count Number of Special Subsequences](https://www.internhack.in/learn/dsa/problem/count-number-of-special-subsequences) (Hard)
42. [Count of Integers](https://www.internhack.in/learn/dsa/problem/count-of-integers) (Hard)
43. [Count Palindromic Subsequences](https://www.internhack.in/learn/dsa/problem/count-palindromic-subsequences) (Hard)
44. [Count Paths That Can Form a Palindrome in a Tree](https://www.internhack.in/learn/dsa/problem/count-paths-that-can-form-a-palindrome-in-a-tree) (Hard)
45. [Count Routes to Climb a Rectangular Grid](https://www.internhack.in/learn/dsa/problem/count-routes-to-climb-a-rectangular-grid) (Hard)
46. [Count Stepping Numbers in Range](https://www.internhack.in/learn/dsa/problem/count-stepping-numbers-in-range) (Hard)
47. [Count the Number of Ideal Arrays](https://www.internhack.in/learn/dsa/problem/count-the-number-of-ideal-arrays) (Hard)
48. [Count the Number of Inversions](https://www.internhack.in/learn/dsa/problem/count-the-number-of-inversions) (Hard)
49. [Count the Number of Powerful Integers](https://www.internhack.in/learn/dsa/problem/count-the-number-of-powerful-integers) (Hard)
50. [Count The Number of Winning Sequences](https://www.internhack.in/learn/dsa/problem/count-the-number-of-winning-sequences) (Hard)
51. [Count The Repetitions](https://www.internhack.in/learn/dsa/problem/count-the-repetitions) (Hard)
52. [Count Unique Characters of All Substrings of a Given String](https://www.internhack.in/learn/dsa/problem/count-unique-characters-of-all-substrings-of-a-given-string) (Hard)
53. [Count Valid Paths in a Tree](https://www.internhack.in/learn/dsa/problem/count-valid-paths-in-a-tree) (Hard)
54. [Count Visited Nodes in a Directed Graph](https://www.internhack.in/learn/dsa/problem/count-visited-nodes-in-a-directed-graph) (Hard)
55. [Count Vowels Permutation](https://www.internhack.in/learn/dsa/problem/count-vowels-permutation) (Hard)
56. [Count Ways to Build Rooms in an Ant Colony](https://www.internhack.in/learn/dsa/problem/count-ways-to-build-rooms-in-an-ant-colony) (Hard)
57. [Count Ways to Distribute Candies](https://www.internhack.in/learn/dsa/problem/count-ways-to-distribute-candies) (Hard)
58. [Count Ways to Make Array With Product](https://www.internhack.in/learn/dsa/problem/count-ways-to-make-array-with-product) (Hard)
59. [Decode Ways II](https://www.internhack.in/learn/dsa/problem/decode-ways-ii) (Hard)
60. [Delete Columns to Make Sorted III](https://www.internhack.in/learn/dsa/problem/delete-columns-to-make-sorted-iii) (Hard)
61. [Delivering Boxes from Storage to Ports](https://www.internhack.in/learn/dsa/problem/delivering-boxes-from-storage-to-ports) (Hard)
62. [Dice Roll Simulation](https://www.internhack.in/learn/dsa/problem/dice-roll-simulation) (Hard)
63. [Difference Between Maximum and Minimum Price Sum](https://www.internhack.in/learn/dsa/problem/difference-between-maximum-and-minimum-price-sum) (Hard)
64. [Digit Count in Range](https://www.internhack.in/learn/dsa/problem/digit-count-in-range) (Hard)
65. [Distinct Subsequences](https://www.internhack.in/learn/dsa/problem/distinct-subsequences) (Hard)
66. [Distinct Subsequences II](https://www.internhack.in/learn/dsa/problem/distinct-subsequences-ii) (Hard)
67. [Distribute Repeating Integers](https://www.internhack.in/learn/dsa/problem/distribute-repeating-integers) (Hard)
68. [Dungeon Game](https://www.internhack.in/learn/dsa/problem/dungeon-game) (Hard)
69. [Encode String with Shortest Length](https://www.internhack.in/learn/dsa/problem/encode-string-with-shortest-length) (Hard)
70. [Find All Good Strings](https://www.internhack.in/learn/dsa/problem/find-all-good-strings) (Hard)
71. [Find All Possible Stable Binary Arrays II](https://www.internhack.in/learn/dsa/problem/find-all-possible-stable-binary-arrays-ii) (Hard)
72. [Find Maximum Non-decreasing Array Length](https://www.internhack.in/learn/dsa/problem/find-maximum-non-decreasing-array-length) (Hard)
73. [Find Minimum Time to Finish All Jobs](https://www.internhack.in/learn/dsa/problem/find-minimum-time-to-finish-all-jobs) (Hard)
74. [Find Number of Coins to Place in Tree Nodes](https://www.internhack.in/learn/dsa/problem/find-number-of-coins-to-place-in-tree-nodes) (Hard)
75. [Find Number of Ways to Reach the K-th Stair](https://www.internhack.in/learn/dsa/problem/find-number-of-ways-to-reach-the-k-th-stair) (Hard)
76. [Find Sum of Array Product of Magical Sequences](https://www.internhack.in/learn/dsa/problem/find-sum-of-array-product-of-magical-sequences) (Hard)
77. [Find the Count of Monotonic Pairs I](https://www.internhack.in/learn/dsa/problem/find-the-count-of-monotonic-pairs-i) (Hard)
78. [Find the Count of Monotonic Pairs II](https://www.internhack.in/learn/dsa/problem/find-the-count-of-monotonic-pairs-ii) (Hard)
79. [Find the Largest Palindrome Divisible by K](https://www.internhack.in/learn/dsa/problem/find-the-largest-palindrome-divisible-by-k) (Hard)
80. [Find the Maximum Length of a Good Subsequence II](https://www.internhack.in/learn/dsa/problem/find-the-maximum-length-of-a-good-subsequence-ii) (Hard)
81. [Find the Maximum Number of Fruits Collected](https://www.internhack.in/learn/dsa/problem/find-the-maximum-number-of-fruits-collected) (Hard)
82. [Find the Maximum Sequence Value of Array](https://www.internhack.in/learn/dsa/problem/find-the-maximum-sequence-value-of-array) (Hard)
83. [Find the Maximum Sum of Node Values](https://www.internhack.in/learn/dsa/problem/find-the-maximum-sum-of-node-values) (Hard)
84. [Find the Minimum Cost Array Permutation](https://www.internhack.in/learn/dsa/problem/find-the-minimum-cost-array-permutation) (Hard)
85. [Find the Number of Possible Ways for an Event](https://www.internhack.in/learn/dsa/problem/find-the-number-of-possible-ways-for-an-event) (Hard)
86. [Find the Number of Subsequences With Equal GCD](https://www.internhack.in/learn/dsa/problem/find-the-number-of-subsequences-with-equal-gcd) (Hard)
87. [Find the Original Typed String II](https://www.internhack.in/learn/dsa/problem/find-the-original-typed-string-ii) (Hard)
88. [Find the Shortest Superstring](https://www.internhack.in/learn/dsa/problem/find-the-shortest-superstring) (Hard)
89. [Find the String with LCP](https://www.internhack.in/learn/dsa/problem/find-the-string-with-lcp) (Hard)
90. [Find the Sum of Subsequence Powers](https://www.internhack.in/learn/dsa/problem/find-the-sum-of-subsequence-powers) (Hard)
91. [Find the Sum of the Power of All Subsequences](https://www.internhack.in/learn/dsa/problem/find-the-sum-of-the-power-of-all-subsequences) (Hard)
92. [Find Weighted Median Node in Tree](https://www.internhack.in/learn/dsa/problem/find-weighted-median-node-in-tree) (Hard)
93. [Form Largest Integer With Digits That Add up to Target](https://www.internhack.in/learn/dsa/problem/form-largest-integer-with-digits-that-add-up-to-target) (Hard)
94. [Freedom Trail](https://www.internhack.in/learn/dsa/problem/freedom-trail) (Hard)
95. [Frog Jump](https://www.internhack.in/learn/dsa/problem/frog-jump) (Hard)
96. [Get the Maximum Score](https://www.internhack.in/learn/dsa/problem/get-the-maximum-score) (Hard)
97. [Handshakes That Don't Cross](https://www.internhack.in/learn/dsa/problem/handshakes-that-dont-cross) (Hard)
98. [Jump Game V](https://www.internhack.in/learn/dsa/problem/jump-game-v) (Hard)
99. [K Inverse Pairs Array](https://www.internhack.in/learn/dsa/problem/k-inverse-pairs-array) (Hard)
100. [Kth Ancestor of a Tree Node](https://www.internhack.in/learn/dsa/problem/kth-ancestor-of-a-tree-node) (Hard)

## Companies that ask dynamic programming problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 67 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 48 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): 31 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 23 of these problems
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs): 13 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 11 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 10 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 9 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 9 of these problems
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys): 8 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 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)
- [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)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

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