Beyondsoft Group Interview Question

Basic recursion problem - was asked to dry-run it.