← Samsung questions

Last non-zero digit of factorial

Filed under Samsung · Also reported at Amazon

Given a non-negative integer N, calculate the last non-zero digit of N! (factorial). Because N can be large, a direct factorial computation will overflow or time out.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.