Domanda di colloquio di MathWorks

Write an algorithm for generating the Fibonacci sequence and how would you optimise it.