Factorial Interview Question

How would you solve the problem I have?