Pergunta de entrevista da empresa Genesys

Write a memoized function, given a function as a parameter.

Resposta da entrevista

Sigiloso

21 de fev. de 2020

This was more difficult as I had a very hazy idea of memoized functions. They had to walk me through some concepts, but once I understood them, I used a map to store previous results. I would check that map when the function got called. If a value existed for a key, I returned it, otherwise, I computed, stored, and then returned the value.