Pregunta de entrevista de Badi

Given a function will be called many times, how would you optimize that?