– spend some time writing down the external interface of the recursive func — exactly what to print/return, and what global variables to update.
– define end-of-recursion condition explicitly. Interviewers want to see that.
– list all important local variables vs global variables on the side. Some variables must be local — on the stack. All others had better be global.
– instance variables should usually be global like static?