PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Intuit

Implement nth Fibonacci number

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's algorithmic problem-solving skills, specifically understanding of recurrence relations, recursion versus iterative implementations, dynamic programming trade-offs, and numerical limits when computing sequence values.

  • easy
  • Intuit
  • Coding & Algorithms
  • Data Scientist

Implement nth Fibonacci number

Company: Intuit

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Onsite

## Problem Write a function that returns the **n-th Fibonacci number**. The Fibonacci sequence is defined as: - \(F(0)=0\) - \(F(1)=1\) - \(F(n)=F(n-1)+F(n-2)\) for \(n \ge 2\) ### Requirements - Input: integer `n` (assume `n >= 0`). - Output: integer `F(n)`. - Discuss time/space complexity and how you would handle large `n`. ### Follow-ups (if asked) - Avoid recursion stack overflow. - Optimize for time (e.g., better than \(O(n)\)) or for very large values.

Quick Answer: This question evaluates a candidate's algorithmic problem-solving skills, specifically understanding of recurrence relations, recursion versus iterative implementations, dynamic programming trade-offs, and numerical limits when computing sequence values.

Related Interview Questions

  • Validate bracket sequence - Intuit (easy)
  • Find Business Degrees of Separation - Intuit (hard)
  • Produce valid student lineup from parent array - Intuit (medium)
  • Find largest filename from ls -l output - Intuit (medium)
  • Sum palindrome-change costs over all substrings - Intuit (medium)
Intuit logo
Intuit
Aug 1, 2025, 12:00 AM
Data Scientist
Onsite
Coding & Algorithms
4
0

Problem

Write a function that returns the n-th Fibonacci number.

The Fibonacci sequence is defined as:

  • F(0)=0F(0)=0F(0)=0
  • F(1)=1F(1)=1F(1)=1
  • F(n)=F(n−1)+F(n−2)F(n)=F(n-1)+F(n-2)F(n)=F(n−1)+F(n−2) for n≥2n \ge 2n≥2

Requirements

  • Input: integer n (assume n >= 0 ).
  • Output: integer F(n) .
  • Discuss time/space complexity and how you would handle large n .

Follow-ups (if asked)

  • Avoid recursion stack overflow.
  • Optimize for time (e.g., better than O(n)O(n)O(n) ) or for very large values.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Intuit•More Data Scientist•Intuit Data Scientist•Intuit Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.