FastPrepDehydrated Strawberry
Problems/Dehydrated Strawberry

Dehydrated Strawberry

Jane Street logoJane Street● EasyNEW GRADFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in six Jane Street interview reports from 2022 to 2026, for trading desk operations roles, in phone screens and first-round math or brainteaser calls. Three reports give the same numbers: a 100 gram strawberry that is 99% water dries until it is 98% water, and the candidate gives its new weight. The other three only name a strawberry water-percentage puzzle.

In the interview it was a mental-math question. We turned it into a function that takes the starting weight and both water percentages. The limits, the whole-number percentages and the 10^-6 tolerance are our own choices, and every example except the first is ours.

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

A strawberry weighs initialMass grams, and initialWaterPercent percent of that weight is water. It is left out to dry. Only water leaves the strawberry, and when it is done, water makes up finalWaterPercent percent of its weight.

Return the new weight of the strawberry in grams.

Answers within 10-6 of the correct value are accepted.

Function

strawberryMass(initialMass: int, initialWaterPercent: int, finalWaterPercent: int) → double

Examples

Example 1

initialMass = 100initialWaterPercent = 99finalWaterPercent = 98return = 50.0

Water is 99% of 100 grams, so the rest of the strawberry weighs 1 gram. Drying does not change that gram. After drying, water is 98%, so the 1 gram is 2% of the new mass. The new mass is 1 / 0.02 = 50 grams.

Example 2

initialMass = 200initialWaterPercent = 90finalWaterPercent = 80return = 100.0

The dry part is 10% of 200, which is 20 grams. After drying it is 20% of the mass, so the mass is 20 / 0.2 = 100 grams.

Example 3

initialMass = 10initialWaterPercent = 60finalWaterPercent = 25return = 5.333333333

The dry part is 40% of 10, which is 4 grams. After drying it is 75% of the mass, so the mass is 4 / 0.75 = 5.333... grams.

Example 4

initialMass = 100initialWaterPercent = 50finalWaterPercent = 0return = 50.0

The dry part is 50 grams. With 0% water left, the strawberry is only its dry part, so it weighs 50 grams.

Constraints

  • 1 <= initialMass <= 106
  • 0 <= finalWaterPercent < initialWaterPercent <= 99

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 US Final Round: 11 Experiences (Part 5 of 10)
  • Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
  • Jane Street TDOE UK Coding Round: 15 Experiences (Part 3 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 TDOE New Grad Interview Questions: 11 Experiences
All Jane Street interview questionsSee Jane Street hiring insights
Saved
class Solution {
    public double strawberryMass(int initialMass, int initialWaterPercent, int finalWaterPercent) {
      // Write your code here.
    }
}
Checking account…