Question bank › Math
Dsa Math Easy

Product of Digits

Given a non-negative integer n, calculate the product of its digits. If the product is less than 10, return that number. Otherwise, continue multiplying the digits of the product until the result is a single-digit number. Input Format: A single line containing the integer n (0 <= n <= 10^6). Output Format: A single line with the final single-digit product. Example: Input: 38 Output: 6

Key concepts

mathdigitsproduct

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.