X interview question

Implement a variety of specific recursive and iterative functions.