โ† Snapdeal questions

Nth Fibonacci number and optimization

Filed under Snapdeal

The question

Write a recursive function to compute the nth Fibonacci number. Modify the implementation using Dynamic Programming to achieve O(1) complexity in most lookup cases.

No write-up yet. Related questions below have one.

Related Snapdeal questions

Collected from public candidate posts and coding forums. Updated Nov 2026.