VigLink interview question

Improve performance of factorial() function, along with basic questions from cracking the coding book