Dsa
Math
Hard
Fibonacci Matrix Exponentiation
Calculate the Nth Fibonacci number using matrix exponentiation. The Fibonacci sequence is defined as F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. You need to output the Nth Fibonacci number modulo 1,000,000,007. The input is a single integer N.
Example:
Input:
10
Output:
55
Key concepts
matricesexponentiationfibonacci
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