FastPrepDigit Orders Divisible by 15
Problems/Digit Orders Divisible by 15

Digit Orders Divisible by 15

Jane Street logoJane Street● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in one Jane Street trading desk operations report from the U.S., posted in 2024. The process it describes has an Excel take-home and then a fast phone round of mostly probability and number theory questions. Its one listed question, with no round named, is a number theory teaser about putting given values in an order that forms a multiple of 15. The report does not give the values and does not say whether one such order or the count of them was wanted.

We read the given values as single digits and chose to count every different number that uses all of them with no leading zero. The limits and all three examples are ours.

Our version is about 65% the same as the reported question.

You are given a list of decimal digits digits. Write a number by placing all of the digits in some order, using each one exactly once. The number may not start with 0.

Return how many different numbers you can write this way that are divisible by 15. Orders that give the same number, such as swapping two equal digits, count only once.

Function

countDivisibleBy15(digits: int[]) → long

Examples

Example 1

digits = [3,0,5,1]return = 10

The digit sum is 9, a multiple of 3, so every arrangement is a multiple of 3. It is a multiple of 15 when it also ends in 0 or 5. Ending in 0, the digits 3, 5, 1 can go in front in 6 orders. Ending in 5, the digits 3, 0, 1 have 6 orders, but the 2 that start with 0 are not allowed, which leaves 4. The total is 10.

Example 2

digits = [1,2,4]return = 0

No arrangement can end in 0 or 5, so none is divisible by 5.

Example 3

digits = [5,5,0,0,2]return = 15

The digit sum is 12. Ending in 0, the rest 5, 5, 0, 2 have 4! / 2! = 12 different orders, 3 of which start with 0, leaving 9. Ending in 5, the rest 5, 0, 0, 2 have 12 orders, 6 of which start with 0, leaving 6. Swapping the two 5s or the two 0s gives the same number, so it is counted once. The total is 15.

Constraints

  • 2 <= digits.length <= 15
  • 0 <= digits[i] <= 9

More Jane Street Phone Screen questions

  • Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
  • Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026
  • Load/Store Arithmetic InterpreterPHONE SCREEN · Seen Oct 2026
  • Instrument Stack Language JumpsPHONE SCREEN · Seen Oct 2026
  • Run a Stack Language InterpreterPHONE SCREEN · Seen Oct 2026
  • Positive-Integer Expression EvaluationPHONE SCREEN · Seen Oct 2026
  • Add Two Integers Given as StringsPHONE SCREEN · Seen Sep 2026
  • Angle Between Clock HandsPHONE SCREEN · Seen Jul 2026
  • Route Length From Two CyclistsPHONE SCREEN · Seen Jul 2026
  • Sort TradesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Best Single Reroll for Five DiceSusquehanna International Group (SIG) · PHONE SCREENSusquehanna International Group (SIG) interview questions
  • Count Array DerangementsInMobi · PHONE SCREENInMobi interview questions
  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Revolver: Will the Next Shot Fire?Tower Research Capital · PHONE SCREEN
  • Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Expected Fake-Name CollisionsMercor · PHONE SCREENMercor interview questions
  • Election District Budget Allocation AnalysisIMC Trading · PHONE SCREENIMC Trading interview questions
  • Count Clean Attendance LogsRippling · PHONE SCREENRippling interview questions
  • Extra Coin Win ProbabilityMicrosoft · PHONE SCREENMicrosoft interview questions
  • Count Staircases with Strictly Increasing StepseBay · ONSITE INTERVIEWeBay interview questions

Interview reports that mention this question

  • Jane Street TDOE Interviews: 165 Experiences (Part 1 of 10)
  • Jane Street TDOE US Phone Screen: 20 Experiences (Part 6 of 10)

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
  • Jane Street TDOE US Final Round: 11 Experiences (Part 5 of 10)
  • Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public long countDivisibleBy15(int[] digits) {
      // Write your code here.
    }
}
Checking account…