Question bank › Dynamic Programming
Dsa Dynamic Programming Warm-up

Fibonacci Sequence

Implement a function that computes the `n`-th number in the Fibonacci sequence, using the dynamic programming approach. The Fibonacci sequence is defined as: fib(0) = 0, fib(1) = 1, and fib(n) = fib(n-1) + fib(n-2) for n > 1. Input format: - A single integer `n` (0 <= n <= 30). Output format: - A single integer, the Fibonacci number at position `n`. Example: Input: 6 Output: 8

Key concepts

dynamic_programmingrecursionmemoization

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.