FastPrepGrandmother's Age From Her Grandchildren
Problems/Grandmother's Age From Her Grandchildren

Grandmother's Age From Her Grandchildren

Jane Street logoJane Street● EasyFULLTIMEINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in five Jane Street interview reports from 2023 to 2026, for trading desk operations roles, mostly in phone screens or math rounds. One report gives the full puzzle: the grandmother's two-digit age has her two grandchildren's ages as its digits, and the three ages add up to 100. Another gives the digit setup without the total, and one only names a grandmother age question. Two reports describe related versions that we did not use: in one her age is the product of her grandsons' ages, and in the other she is 84 and the grandchildren meet extra conditions that the report does not give.

We turned it into a function that takes the total. Totals other than 100, returning -1 when no age works, allowing a grandchild aged 0, the limits and every example except the first are our own choices.

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

A grandmother's age is a two-digit number. Her two grandchildren are as old as the two digits of that number: one is as old as the tens digit and the other as old as the ones digit. For example, if she were 73, the grandchildren would be 7 and 3. A grandchild may be 0 years old.

The grandmother's age and the ages of the two grandchildren add up to total. Return the grandmother's age, or -1 if no two-digit age works. At most one age can work.

Function

grandmotherAge(total: int) → int

Examples

Example 1

total = 100return = 86

Write her age as 10a + b, so the grandchildren are a and b years old and the total is 11a + 2b = 100. Since 2b and 100 are even, a must be even. With a = 8 we get 2b = 12, so b = 6. Check: 86 + 8 + 6 = 100. A smaller even a would need b above 9.

Example 2

total = 50return = 43

43 + 4 + 3 = 50. Here 11a + 2b = 50 gives a = 4 and b = 3.

Example 3

total = 101return = 91

91 + 9 + 1 = 101. The total is odd, so a must be odd, and a = 9 leaves 2b = 2.

Example 4

total = 11return = 10

10 + 1 + 0 = 11. The younger grandchild is a baby under one year old.

Example 5

total = 12return = -1

We need 11a + 2b = 12 with a at least 1. The total is even, so a is even and at least 2, but then 11a = 22 is already more than 12. No age works.

Constraints

  • 1 <= total <= 200

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

  • Sqrt(x)LinkedIn · PHONE SCREENLinkedIn interview questions
  • Automation Pipeline, Part 1: Single WorkerPlaid · PHONE SCREENPlaid interview questions
  • Subtract Two Large Number StringsStackAdapt · PHONE SCREENStackAdapt interview questions
  • Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
  • Circular Primes Below a LimitAmazon · PHONE SCREEN
  • Palindrome NumberKotak Mahindra Bank · PHONE SCREENKotak Mahindra Bank interview questions
  • Streaming AverageXantium · PHONE SCREEN
  • Fair Coin from a Biased CoinAnthropic · PHONE SCREENAnthropic interview questions
  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN

Interview reports that mention this question

  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
  • Jane Street TDOE Interviews: 165 Experiences (Part 1 of 10)
  • Jane Street TDOE US Phone Screen: 20 Experiences (Part 6 of 10)
  • Jane Street TDO Experienced Hire Interview: 1 Experience
  • Jane Street TDOE Intern Interview Questions: 8 Experiences

Jane Street interview experiences

  • Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public int grandmotherAge(int total) {
      // Write your code here.
    }
}
Checking account…