Dsa
Recursion
Warm-up
Generate Fibonacci Sequence
Write a function that generates the first n Fibonacci numbers using recursion, where n is a non-negative integer. For example, given the input '5', the output should be '0 1 1 2 3'.
Example Input:
5
Example Output:
0 1 1 2 3
Key concepts
recursionsequence generation
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now