Five Pumpkins Weighed in Every Pair: Find the Total Weight
Company: Jane Street
Role: Data Scientist
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
You have 5 pumpkins. You weigh them two at a time, in every possible pairing, and the scale readings for the ten pairs are:
$$21,\ 22,\ 23,\ 24,\ 25,\ 26,\ 27,\ 28,\ 29,\ 30 \text{ pounds.}$$
You are not told which pair of pumpkins produced which reading. What is the total weight of all five pumpkins?
This is a phone-screen mental-math question — you should be able to reason it out and get an exact number without a calculator.
```hint Count the appearances
There are $\binom{5}{2} = 10$ pairings. If you add up all ten scale readings, how many times does each individual pumpkin get counted in that grand sum?
```
```hint Arithmetic series
The ten readings are consecutive integers, so their sum is quick to compute: pair them up from the outside in, or use $\frac{(\text{first} + \text{last}) \times \text{count}}{2}$.
```
### Constraints & Assumptions
- All $\binom{5}{2} = 10$ distinct pairs are weighed exactly once.
- The scale is exact (no measurement error); treat the ten readings as given data to work with, even if their exact realizability by five real weights is not assumed up front.
- Individual pumpkin weights are positive real numbers — they are not required to be whole pounds.
- The ten readings are given as a multiset; the correspondence between readings and pairs is unknown.
### Clarifying Questions to Ask
- Does "any two at a time" mean all $\binom{5}{2} = 10$ possible pairs, each weighed exactly once?
- Do we know which reading corresponds to which pair, or only the multiset of ten values?
- Can individual pumpkins have non-integer weights, even though every pairwise reading is a whole number?
- Is the question asking only for the total weight, or also for the individual weights?
### What a Strong Answer Covers
- **A counting argument that avoids matching readings to pairs:** recognizing that some way of aggregating all ten readings together lets you recover the total weight without ever figuring out which reading belongs to which pair.
- **Clean arithmetic:** summing the ten given readings efficiently and carrying the division through correctly, comfortable with a non-integer final answer.
- **Generalization awareness:** seeing that the argument would extend to any number of objects weighed in all pairs, not just five.
- **Rigor as a bonus:** noticing that the ten readings over-determine the five individual weights, and being able to discuss whether the data is exactly realizable versus which quantity the identity pins down regardless.
### Follow-up Questions
- Can you determine the individual weights of the five pumpkins, not just the total? Which readings can you immediately identify (e.g., what must the smallest and largest readings correspond to)?
- Generalize: $n$ objects are weighed in all $\binom{n}{2}$ pairs. Express the total weight in terms of the sum of the pairwise readings.
- Suppose one of the ten weighings was lost and you only have nine readings. Can you still recover the total weight? What additional reasoning is needed?
- The ten pairwise readings here are all integers. Does that force the individual pumpkin weights to be integers? Why or why not?