FastPrepReduce a Number to One Digit
Problems/Reduce a Number to One Digit

Reduce a Number to One Digit

Accenture logoAccenture● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two public reports describe the same Elite Engineer assessment task. They call it Digit Sum and Reduce a Number to One Digit. The exact examples and the limit on the number are not shown. Our version is about 80% the same as the reported questions.

Given a non-negative integer num, repeatedly replace it with the sum of its decimal digits until only one digit remains.

Return that final single digit. If num is already a single digit, return it unchanged.

Function

reduceToOneDigit(num: int) → int

Examples

Example 1

num = 38return = 2

The first digit sum is 3 + 8 = 11. Summing again gives 1 + 1 = 2.

Example 2

num = 0return = 0

0 is already a single digit, so it is returned unchanged.

Example 3

num = 9998return = 8

The reductions are 9 + 9 + 9 + 8 = 35 and then 3 + 5 = 8.

Constraints

  • 0 <= num <= 10^9.

More Accenture interview questions

  • Nearest Composite NumberOA · Seen Sep 2026
  • Minimum Password IncrementsOA · Seen Sep 2026
  • Candy DistributionOA · Seen Sep 2026
  • Customers Who Never OrderedOA · Seen Sep 2026
  • Economical TripOA · Seen Sep 2026
  • Coin ChangeOA · Seen Sep 2026
  • Validate Email AddressOA · Seen Sep 2026
  • Closest Rhyming WordOA · Seen Aug 2026
  • Array Leader ElementsOA · Seen Nov 2025
  • Alternating Index Square SumONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • Costliest ChocolateRippling · OARippling interview questions
  • Distinct Chapters Missed During a Cyclic AbsenceVisa · OAVisa interview questions
  • Count Palindromic Base RepresentationsSEDEMAC · OA
  • Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
  • Calculate the Half SpreadMillennium · OAMillennium interview questions
  • Plus Mult ArrayIBM · OAIBM interview questions
  • Product Minus Sum of DigitsTikTok · OATikTok interview questions
  • Progressive Tax CalculatorInteractive Brokers · OA

Accenture interview experiences

  • Accenture New Grad ASE OA Questions: 15 Experiences
All Accenture interview questionsSee Accenture hiring insights
Saved
class Solution {
    public int reduceToOneDigit(int num) {
        // Write your code here.
    }

}
Checking account…