Thought process for writing recursive methods

I was interviewing one candidate the other day and found that he is facing difficulties in writing a recursive method. This is not the first time I am seeing people facing problems with recursion. In this post, I will try to explain the thought process to write recursive methods.

This post is intended for beginners who don’t have any idea about recursion. If you are an intermediate or above level, you don’t find this as useful. Continue reading