Frage im Vorstellungsgespräch bei Microsoft

How to refactor recursive calls to avoid possible stack overflow?