MathWorks interview question

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