Explain recursion in a way that a non-technical person may comprehend.
Let’s understand this question in a way our grandmother can get by following points-
- Always remember one thing for a recursive program, the program calls itself at the end or return stage.
- If the user leaves the program’s end, the program will never stop calling and hence enter into a recursive state.
- It is mandatory to set the end conditions at the top otherwise it will run forever.
Suppose you are typing recursion in a web browser and it comes “Did you mean: recursion”? Click on that message. It will appear again. Now click again and there it is again. Click it….Ok enough. This process is recursion.
BY Best Interview Question ON 23 Feb 2022