Sum of factorial digits
Your code only works for small values of N. The algorighm is effective, but unfortunately your overflows are real.

Factorial numbers get very big, very fast... I think it is around 12! that you run out of space in a 32-bit integer, and about 20! that your run out of space in a 64-bit long.

You need to convert your logic to use BigInteger instead of Long for it to work at all.