- 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. Simplifies the visualization. Any variable passed into a recursive call is additional state on every stack frame and makes the logic harder to reason about. This is more serious when there are many such local states to keep in mind