Grokking Dynamic Programming Patterns for Coding Interviews
Master Dynamic Programming by learning coding patterns. Act smartly, and follow the Dynamic Programming patterns.

Course Overview
The fact is, Dynamic Programming (DP) problems can be some of the most intimidating on a coding interview. Even when it's actually clear if a problem can be solved using DP (which it rarely is), it can be pretty challenging to even know where to start on the solution. Unless, that is, you're trained on the approach to solving DP problems. This course was made from scratch with just that goal in mind. It'll equip you with a set of easy-to-understand techniques to handle any DP problem. Rather than just having you try to memorize solutions, you'll be walked through five underlying DP patterns that can then be applied to solve 35+ DP problems. In each pattern, we'll start with a recursive brute-force solution -- this is actually the best way to start solving a DP problem! Once we have a recursive solution, we'll then apply the advanced DP methods of Memoization and Tabulation. The practice problems in this course were carefully chosen, covering the most frequently asked DP questions in coding interviews.
What you'll learn in Grokking Dynamic Programming Patterns for Coding Interviews
- Five dynamic programming patterns that between them cover most interview questions: 0/1 knapsack, unbounded knapsack, Fibonacci numbers, palindromic subsequence, and longest common substring.
- 35 problems with full solutions, grouped by the pattern they share rather than scattered, which is what makes the recurrence start to look familiar.
- How to convert a recursive solution into a memoized one mechanically, which is the safest move available to you under interview pressure.
- The knapsack family in depth: equal subset sum partition, subset sum, minimum subset sum difference, count of subset sum, and target sum, all from one recurrence.
- Solutions in Python, Java, C++, JavaScript, Go, and C#, so the pattern is what you carry away rather than one language’s syntax.
- Every problem solved three times over: the plain recursive solution, top-down with memoization, and bottom-up tabulation, so you can watch one turn into the next.
- How to find the recurrence relation, which is the single step that decides whether you solve a dynamic programming question or stall on it.
- How to turn memoization into a bottom-up table, and how to reason about the order you have to fill it in.
- The string patterns interviews return to again and again: longest common subsequence, edit distance, longest increasing subsequence, and palindromic partitioning.
- Why dynamic programming is a recognition problem rather than a memorisation problem, which is the only reason an unseen question is survivable.
Course Content
Introduction
Pattern 1: 0/1 Knapsack
Pattern 2: Unbounded Knapsack
Pattern 3: Fibonacci Numbers
Pattern 4: Palindromic Subsequence
Pattern 5: Longest Common Substring
Appendix
What people say about our courses
About the Author

Arslan Ahmad
Industry Expertise & Leadership
Arslan Ahmad is the lead author of Grokking Dynamic Programming Patterns for Coding Interviews. As the founder of Design Gurus and a former FAANG hiring manager, he has worked at industry giants like Facebook (now Meta) and Microsoft.
He has conducted hundreds of system design interviews, giving him unique insight into what top tech companies look for in candidates.
The course also incorporates expertise from senior engineers at Google, Meta, Amazon, Microsoft, and Uber, ensuring you learn system design best practices from professionals who have built and scaled real-world systems.
500+
Interviews Conducted
10k+
Students Taught
FAQs
What is Grokking Dynamic Programming Patterns for Coding Interviews?
It is a course that treats dynamic programming as five recurring patterns rather than as a hundred unrelated problems. Each pattern gets a chapter, and each problem inside it is solved three ways, starting from plain recursion, then adding memoization, then rebuilding it bottom-up, so you see exactly where the speedup comes from.
Who is this course for?
Engineers who can handle most coding interview topics and lose their nerve on dynamic programming. That covers a lot of people: DP is the topic candidates most often skip entirely and then meet in a final round. You should be comfortable with recursion and Big-O before starting.
Which patterns does it cover?
0/1 knapsack, unbounded knapsack, Fibonacci numbers, palindromic subsequence, and longest common substring. Those five account for the overwhelming majority of dynamic programming questions asked in interviews, which is why the course spends its time going deep on them instead of cataloguing every variant that exists.
Why is every problem solved three different ways?
Because that progression is the actual skill. In an interview you will almost never leap straight to an optimal bottom-up table. You will write the brute force recursion, spot the repeated subproblems, add memoization, and only then decide whether to invert it. Practising the whole chain means you always have a correct answer on the board, even when the clock beats you to the elegant one.
Which problems are included?
Among the 35: subset sum, equal subset sum partition, minimum subset sum difference, target sum, coin change and minimum coin change, rod cutting, maximum ribbon cut, staircase, house thief, minimum jumps to reach the end, longest palindromic subsequence and substring, palindromic partitioning, longest common subsequence, edit distance, longest increasing subsequence, shortest common super-sequence, and strings interleaving.
Which programming languages are supported?
Python, Java, C++, JavaScript, Go, and C#. Every solution is given in all six at each of the three stages, so you can follow the recursion to memoization to tabulation progression in whichever language you will interview in.
Do I need to finish Grokking the Coding Interview first?
No, this course stands on its own, and dynamic programming is self-contained enough that you can take it in isolation. If you are working through both, the natural order is patterns first and this one second, since it goes considerably deeper on DP than a single chapter of a general patterns course can.
What background do I need?
Comfort with recursion, arrays, and basic complexity analysis. You do not need any prior exposure to dynamic programming: the course opens by explaining what it is and why overlapping subproblems make it work, before the first pattern begins.
Is the course text-based or video-based?
Text-based, with diagrams for the tables and runnable code at each of the three solution stages. That suits DP unusually well, because most of the learning happens while comparing a memoized version against a tabulated one line by line, which is painful to do in a video.
Do I get a certificate of completion?
Yes. Design Gurus issues a certificate once you have completed the course, and you can share the link directly or add it to your LinkedIn profile.
