EASYasked at 13 companies

Fibonacci Number

A easy-tier problem at 73% community acceptance, tagged with Math, Dynamic Programming, Recursion. Reported in interviews at EY and 12 others.

Founder's read

Fibonacci Number looks like a warm-up but it's a trojan horse for understanding recursion, memoization, and dynamic programming patterns you'll see in harder problems. Companies like Nvidia, Bloomberg, and EY ask it frequently, sometimes as a screener, sometimes buried in a multi-part question where your solution strategy matters more than the answer. The 73% acceptance rate masks a critical split: naive recursion tanks on larger inputs, and the interviewer knows it. You need to show you can recognize exponential blowup and pivot to a better approach. If you blank on optimization during your live assessment, StealthCoder surfaces the working solution in seconds, invisible to the proctor.

Companies asking
13
Difficulty
EASY
Acceptance
73%

Companies that ask "Fibonacci Number"

If this hits your live OA

Fibonacci Number is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too.

Get StealthCoder
What this means

The trap is implementing raw recursion (fib(n) = fib(n-1) + fib(n-2)) and watching it time out on n=35 or higher. Most candidates don't realize they're recomputing the same subproblems thousands of times. The actual work is recognizing that you need to store intermediate results. Memoization (top-down) or dynamic programming (bottom-up) both solve it, but they require you to articulate why. A few candidates even code an O(1) math solution using the closed-form formula, which impresses but isn't the point. The real test is pattern recognition: when you see overlapping subproblems, cache them. This lesson transfers directly to harder DP problems. StealthCoder is your hedge if the pressure makes you freeze on which approach to code first during the live OA.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Fibonacci Number recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by an Amazon engineer who watched the leaked-problem repo become an industry secret. He decided you should have it too. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Fibonacci Number interview FAQ

Is Fibonacci still asked at major companies or is it just a leetcode trope?+

It's still live. Nvidia, Bloomberg, EY, and others in the top list request it. Often it's a warm-up to see if you code defensively and optimize without being told. It also appears as a subproblem in DP sequences, so recognizing the pattern quickly matters.

What's the actual trick that separates weak from strong answers?+

Recognizing exponential recursion is a dead-end and pivoting to memoization or DP without being prompted. Strong candidates also discuss space-time tradeoffs and might mention that iteration with two variables beats array DP for space. Weak answers recompute everything or overthink it.

How does Fibonacci relate to the other topics listed (Math, Recursion, Memoization, DP)?+

It's the textbook example of all four. Math handles the formula. Recursion is the intuitive but broken approach. Memoization and DP are the two fixes. Interviewers use it to see which concepts you can connect. Understanding Fibonacci deeply means you get the whole toolbox.

Will they ask me to optimize further after I submit the DP solution?+

Likely, yes. After DP, expect a follow-up: can you do it iteratively with O(1) space. Then maybe the closed-form formula. Interviewers want to see how far you can push the problem once you've proven you understand the basic pattern.

If I get asked this live and I panic, how much time do I have to recover?+

Fibonacci is usually a 10-15 minute problem, so you have time to think out loud and course-correct. The danger isn't the problem itself, it's self-doubt spiraling. StealthCoder solves it in seconds if you blank, letting you move forward without the shame tax.

Want the actual problem statement? View "Fibonacci Number" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.