← Goldman Sachs questions

Fibonacci for large n

Filed under Goldman Sachs

Calculate the n-th Fibonacci number efficiently for very large values of n (e.g., n up to 10^9), returning the result modulo a given number if required, or using matrix exponentiation / fast doubling.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.