Memoization is an optimization technique where we store the result of a function call for specific input values, and on subsequent calls with the same arguments we return the already computed result instead of recalculating everything from scratch.
Let's look at a simple example
Imagine you're working on a crypto exchange and you need to recalculate the price of coins in USD and show it to the user.
If the user's balance and the coin prices haven't changed, we can memoize the result of the calculation and return it from the cache, instead of multiplying all the coins by their prices again every time. For example, the price of USDT barely changes, so we can keep serving it from the cache until the client tops up their account.
In an interview context, it's important to stress that this technique matters especially in environments with limited CPU resources. For example, the mobile version of a website or various hybrid apps built with React Native, Expo, Ionic, etc.