Pergunta de entrevista da empresa Amazon

Calculate the nth fibonacci sequence. How would you optimize the algorithm.