Skip to content

Instantly share code, notes, and snippets.

@cjsim89
Created December 5, 2023 15:35
Show Gist options
  • Save cjsim89/c68e55478217698761ba173ad788093c to your computer and use it in GitHub Desktop.
Save cjsim89/c68e55478217698761ba173ad788093c to your computer and use it in GitHub Desktop.
Nth fibonacci

Return the nth Fibonacci

The Fibonacci series is a numerical series where each item is the sum of the two previous items. It starts off like this:

0, 1, 1, 2, 3, 5, 8, 13, 21 ...

Write a method called fib() that takes an integer n and returns the nth Fibonacci.

Interview Tips

Be sure you can talk through each part of your thinking with your partner.

Supplement your solution with unit & integration tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment