

Welcome to the Python screen for the Software Engineer role at Flowcode.
The question is on your right: Compute Nth Fibonacci Number. Read through the requirements first.
Would you like to talk through your approach, or are you ready to start coding?
On a Glassdoor engineering screen, you may be asked to implement a basic sequence generator efficiently. Write a function that returns the nth Fibonacci number.
The Fibonacci sequence is defined as:
F(0) = 0F(1) = 1F(n) = F(n - 1) + F(n - 2) for n >= 2nF(n)Your solution should handle the base cases correctly and avoid the exponential slowdown of naive recursion.
n is an integerdef fibonacci(n):