Goldman Sachs interview question

Write fib algorithm and optimize it