NatWest Group interview question

Code a class which will work out factorials