Code Challenge #11: June 21, 2017
Every week, we feature the type of brainteasing question that might be asked in a fullstack developer's job interview at places such as Google and Facebook.
This week's challenge is a very common interview question and was reported to have been asked in interviews at many top companies including Google:
Basic Difficulty
Write a function,
fibonacciFinder50
, that will find the 50th number in the Fibonacci Sequence.

Function Name:
fibonacciFinder50
 Input: There are no parameters to this function
 Output: an integer, the 50th number in the Fibonacci Sequence

Example:
fibonacciFinder50() => 7778742049
 In the Fibonacci Sequence, the first two numbers are
0
and1
and every number thereafter is the sum of the previous two numbers in the sequence  For this challenge, consider
0
to be the1st
Fibonacci Number, not the0th
(i.e. do not zeroindex)
Find out more about basic challenges.
Intermediate difficulty
Write a function,
fibonacciFinderN
, that will find then
th number in the Fibonacci Sequence.

Function Name:
fibonacciFinderN

Input: any integer,
n
, wheren
is a natural number (in this case not including 0) 
Output: an integer, the
n
th number in the Fibonacci Series 
Example:
fibonacciFinderN(300) => 137347080577163115432025771710279131845700275212767467264610201
 Please use this example – the 300th Fibonacci Number – with your submission
Find out more about intermediate challenges.
Hard Difficulty
Write
fibonacciFinderN
as efficiently as possible.
 Can you solve this challenge in
O(n)
time complexity?  Many of you will still find that this challenge is too easy (and this is not unusual), so see how you can stretch yourself further. Can you solve this problem in an unorthodox or elegant way? How about in a different language? Take this opportunity to show off your scripting skills and creative outsidethebox thinking!
Find out more about hard challenges and Big O
Reply
to this thread with a link to your code on repl.it and paste your properly formatted code to participate! Don't just submit your code, remember to explain
your solution, too! If you want to be considered as the winner, your function must
have the correct name
and provide output in the format specified
above, you also need to abide by our other simple rules.
As always solutions using imports to do all the heavy lifting such as itertools
will not be considered for the winner.
The fine print:
Click the links to find out more about:
 the rules & how to participate in challenges
 how challenges are used as job interview questions
 why Codecademy runs challenges (and why they are formatted this way)
 more details about the challenges and why we think they are useful.
 find previous challenges (and see the past winners) in our Challenge Index