Dsa
Math
Medium
Fibonacci Digit Sum
Given an integer n, return the sum of the digits of the nth Fibonacci number.
For example, given the input:
7
The output should be:
13 (Fibonacci numbers: 0, 1, 1, 2, 3, 5, 8, 13; sum of digits of 13 is 1 + 3 = 4).
Input format:
- A single integer n (0 ≤ n ≤ 30).
Output format:
- A single integer representing the sum of the digits of the nth Fibonacci number.
Key concepts
fibonaccimath
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