Barclays interview question

Write a function to resolve n!