Talentd
FleetCode
Make and follow sheets.Sign in

Memoization Problems (42)

Problems tagged with Memoization. Start with the easy ones, then move to medium and hard.

3 Easy12 Medium27 Hard

Learn these first

1
Array

Many memoization problems involve arrays where states are defined by indices or ranges, making array-based caching tables common in practice.

2
Recursion

Memoization builds directly on recursive problem solving. Understanding recursive calls, base cases, and call stacks helps you identify overlapping subproblems that can be cached.

3
Hash Table

Most memoization implementations use hash maps or dictionaries to cache results for previously solved states, especially when states contain multiple parameters.

4
Dynamic Programming

Memoization is essentially the top-down form of dynamic programming. Learning DP concepts like optimal substructure and state transitions helps you design effective memoized solutions.

TitleSolutionAcceptDifficultyTopics
140. Word Break IIVideo
Solution56.4%Hard
Array, Backtracking +5· 16 companies
488. Zuma GameVideo
Solution29.4%Hard
546. Remove BoxesVideo
Solution50.0%Hard
Array, Dynamic Programming +1· 12 companies
773. Sliding PuzzleVideo
Solution74.3%Hard
Array, Backtracking +4· 7 companies
913. Cat and MouseVideo
Solution36.2%Hard
Solution41.6%Hard
Bit Manipulation, Bitmask +2· 1 company
1728. Cat and Mouse IIVideo
Solution40.4%Hard
Array, Dynamic Programming +6· 1 company
Solution53.4%Hard
Array, Dynamic Programming +1· 1 company
Solution35.6%Hard
Array, Dynamic Programming +3· 2 companies
Showing 1–27 of 27

More about Memoization

Memoization is an optimization technique used to speed up recursive algorithms by caching previously computed results. Instead of recalculating the same subproblem multiple times, memoization stores the answer and reuses it when the same input appears again. This dramatically reduces time complexity in many algorithmic problems and is a core technique in Dynamic Programming.

In coding interviews, memoization often appears in problems involving overlapping subproblems such as Fibonacci variations, path counting, string segmentation, or state-based decisions. Many brute-force recursive solutions can be transformed into efficient algorithms simply by adding a lookup table or cache. Interviewers frequently expect candidates to recognize this pattern quickly, especially when working with Recursion and exponential-time solutions.

Memoization usually works by storing results in a dictionary, map, or array indexed by the function's parameters. Developers commonly implement it using a Hash Table for flexible state storage or arrays when the state space is bounded. When combined with problems involving sequences or grids, it also frequently interacts with Array or Matrix data structures.

Common memoization patterns include:

  • Caching results of recursive subproblems
  • Using a map keyed by multiple parameters (e.g., index + state)
  • Top-down dynamic programming with memo tables
  • State compression when the number of parameters grows

You should consider memoization whenever a recursive solution recomputes the same subproblem repeatedly. Converting exponential recursion into a memoized solution often reduces complexity to polynomial time. Practicing memoization problems helps you recognize dynamic programming patterns faster and write optimized interview-ready solutions.

FleetCode provides designed to strengthen your understanding of caching strategies, recursive state design, and top-down dynamic programming techniques used in real coding interviews.

Memoization: common questions

What is the best way to learn Memoization?

Start by writing a brute-force recursive solution, then identify repeated subproblems. Add a cache (array or hash map) to store computed results and reuse them when the same state appears again. Practicing progressively harder problems reinforces the pattern.

What are common Memoization patterns in DSA?

Common patterns include caching recursive results by index, memoizing states with multiple parameters, top-down dynamic programming with lookup tables, and using bitmasks or strings as state keys for complex problems.

Is Memoization important for FAANG interviews?

Yes. Memoization is frequently tested in FAANG-style interviews because it demonstrates understanding of dynamic programming and optimization techniques. Many medium and hard DP problems can first be solved using a memoized recursive approach.

What are the best Memoization problems for coding interviews?

The best memoization problems involve recursive structures with overlapping subproblems such as Fibonacci variants, word break, grid path counting, and partition problems. These questions test your ability to convert exponential recursion into efficient top-down dynamic programming.

What is the difference between Memoization and Dynamic Programming?

Memoization is a top-down approach where recursion is used and results are cached during execution. Dynamic programming often refers to the bottom-up approach where a table is built iteratively, though both rely on the same principles of overlapping subproblems and optimal substructure.