To me it seems a fairly unimportant exercise that proves little other than that you know the formula for the Fibonacci sequence of the top of your head under duress.
To me it seems a fairly unimportant exercise that proves little other than that you know the formula for the Fibonacci sequence of the top of your head under duress.
Though not knowing what Fibonacci is might still be a little bit suspect, given how often it is used in examples and literature in general as a "very simple" recursive function. One might think that the candidate hasn't explored their field very much.
It's a good question for junior people because there's so many ways to write it: iterative, recursive, recursive + memoized, eagerly streamed, lazily streamed.
That said, it is not a problem you'll have in the real world, so at best it's good to get a feel for how a candidate thinks through problems, how easily they can reframe an algorithm in different ways, and how they can reason about tradeoffs of different approaches.