Dynamic programming interview questions

Turning repeated recursion into tables: state, transition, base case and fill order, from one-row counts to two-string tables, with the memory tricks interviewers ask about.

5 quick facts

– interview-ready · 18 questions in this topic

– of 18 tried

Saved on this device. Interview-ready means you got it right on two different days. Guesses and hints count for less.

Questions

  1. Ways to cross n stepping stones, one or two at a timePredict
  2. Fewest coins to make an amountPredict
  3. Fewest edits to turn one word into anotherPredict
  4. Best haul without opening two neighbouring lockersPredict
  5. Best haul when the lockers form a ringPick the fix
  6. Ways to read a digit string as letters (1 = A … 26 = Z)Predict
  7. Can a string be split into dictionary words?Predict
  8. Longest rising sequence of picks from a listPredict
  1. Longest shared subsequence of two stringsPredict
  2. Routes across a grid with blocked cellsPredict
  3. Cheapest route from top-left to bottom-rightPredict
  4. Split items into two piles of equal weightPredict
  5. Number of ways to pay an amount with unlimited coinsPredict
  6. Largest product of a contiguous runPredict
  7. Dynamic programming in four stepsOrder the steps
  8. Top-down caching or bottom-up tables?Predict
  9. Saving memory with rolling rowsPredict
  10. How to tell a problem needs DPPick the fix

Practise this topic

Flashcards · 28

Flip, then say if you knew it. Needs JavaScript; every answer is also on its question page.

Quick quiz · 18 questions

One exercise per question, checked as you go. Needs JavaScript.

Mock interview · 3 sets

Timed, out loud, then tick what you covered. Needs JavaScript.

Quick facts

Recall the answer first, then tap Show to check.

Sources: Topic outline informed by the Tech Interview Handbook by Yangshun Tay and the NeetCode 150 pattern grouping by neetcode-gh, both MIT licensed. Every problem, solution and explanation is written by Best Latest Apps. Credits and license