Photo by Juliana Malta on Unsplash

There are few programs which teach us so much in so few lines of code.One of the best programs I like to code and see people code is computing the Fibonacci number.

F(n) = F(n-1) + F (n-2)

The Fibonacci program can be approached in 2 ways — recursive and iterative.

Let’s start with the recursive one.

Plain and simple right? Wait, hold your horses. Let’s start computing.


In Life you are dependent on a lot of external parties and so are you in software. Just like real world, an external system may not always fulfill the requirements of our system and hence “Retries”. Let’s try to capture some principles of Retries via a boy and girl story :)

Scenario — A boy has finally gathered enough courage and is proposing to his ladylove.

Boy proposes, girl says → “I am married!”

Retry Strategy → Don’t!

Analysis → Use this strategy when there is an irrecoverable error. It’s like 422 Unprocessable Entity, 451 Unavailable For Legal Reasons, 410…

Rahul Bansal

Solving problems through software

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store