NTT DATA interview question

Multiple ways to write a function who return a factorial