Amazon Interview Question

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