What is memoization?

Updated May 17, 2026

Short answer

Memoization caches function results to avoid recomputation.

Deep explanation

It stores results of expensive function calls based on input arguments, improving performance in recursive or repeated computations.

Real-world example

Dynamic programming problems like Fibonacci optimization.

Common mistakes

  • Not handling memory growth in large caches.

Follow-up questions

  • Memoization vs caching?
  • When not to use memoization?

More Optimisation interview questions

View all →