2 comments

0

I always avoid recursion at any cost. Most of the time you can rewrite the code without recursion.

Recursion is hiding the code constructs and is incredibly hard to debug. You may understand it at this moment, but as your program ages, languages change, syntax change, it is going to kick your ass big.

My advice: avoid them.

0

but it is fun though.. and these are interview questions not real world problems.. candidate is expected to know recursion :)