Microsoft interview question

[Round 2] 1) Implement Stack 2) Implement Factorial