Problems/

Memoization vs Tabulation

medium

Concept check — write, then compare

Dynamic programming is usually implemented one of two ways: memoization (top-down) or tabulation (bottom-up). Explain both.

Your answer should cover:

  1. What property a problem needs before DP applies at all (name and explain the two classic conditions).
  2. How memoization works mechanically, and what it adds to plain recursion.
  3. How tabulation works mechanically, and how you decide the fill order.
  4. The practical trade-offs: when would you pick each? (Think: code clarity, stack limits, subproblem coverage, space optimisation.)
  5. Illustrate with Fibonacci or Climbing Stairs: show how the same recurrence appears in both styles.
Explaining out loud is the test — write as if teaching someone.