Amazon interview question

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