Jane Street interview question
Split stones into piles to maximize the product of pile sizes
- Company:
- Jane Street
- Round:
- Phone screen
- Type:
- Coding
- Difficulty:
- Easy
- Reported:
- June 2, 2026
Problem
You have S identical stones and must divide them into exactly n non-empty piles. Return the maximum possible product of the pile sizes. Also write a function that returns the best product over all possible numbers of piles.
Example 1
Input: S = 10, n = 2
Output: 25
Piles of 5 and 5 give 25.
Example 2
Input: S = 10, n = 3
Output: 36
Piles of 3, 3 and 4 give 36, which is also the best over all n for 10 stones.
Constraints
1 <= n <= S <= 1000
Reported by candidates or drawn from publicly available sources, and rewritten in our own words. Pathwise Prep does not publish confidential assessment content. Report a concern