Question d’entretien chez Microsoft

How to refactor recursive calls to avoid possible stack overflow?