In this course, you’ll practice two patterns for problems built from a sequence of choices: backtracking and dynamic programming. They often start from the same recursive idea. Backtracking uses it to build every answer, while dynamic programming reuses smaller answers so it never has to build them all.
What You’ll Practice
- Backtracking: build candidates one choice at a time, undo each choice before you try the next one, and abandon a partial answer as soon as it can’t work
- Dynamic programming: name the smaller question that keeps coming up, answer it once in a
Mapor a table, and combine those answers into counts, minimums, and maximums
You’ll also run into JavaScript details that interviewers like to probe:
- Why
results.push(path)leaves you with a list of empty arrays - Why a
Setof[row, col]arrays never finds a cell, and why you can’t mark a letter in a string as visited - Why a count past 2⁵³ needs
BigInt, and why1n + 1throws - Why
new Array(3).fill([])gives you one row three times - Why
Math.min()returnsNaNwhen you read past the edge of a table, and why deep recursion ends in aRangeError
How the Course Works
- Concept lessons introduce each pattern with short examples you can run.
- Exercises run in your browser on Node 26, so you don’t need to install anything. Each problem is set in a web-app scenario. Get a working solution first. Then a bonus test plays the interviewer’s follow-up: does your solution still hold up when the input gets large?
- An AI-code review hands you a plausible topping combiner with hidden bugs. Your job is to find them and fix them, which is the skill you need whenever an assistant writes code for you.
- Recaps at the end of each section let Mentor AI look at your attempts and talk through whatever hasn’t clicked yet.
- Mixed Practice ends the course with problems that don’t name their pattern, a quiz on choosing the right one, and a full mock interview.
Before You Start
You should be comfortable writing JavaScript functions, working with arrays, objects, and loops, and reading a recursive function. The exercises use Map and Set often. If recursion feels rusty, the fourth course in this path, JavaScript Coding Interview: Linked Lists and Trees, covers it, including the call stack’s limits. Knowing what O(n), O(n²), and O(2ⁿ) mean helps, and the concept lessons review the costs you’ll need.
This is the last course in the JavaScript Coding Interview Practice path, so its summary also looks back at the whole path.
Your Cheat Sheets
Two cheat sheets go with every course in this learning path. Keep them open while you practice. The patterns sheet shows how to spot each interview pattern, with a JavaScript template for it, and the complexity sheet lists what common JavaScript operations cost in time and space.