Find the Probability That One Shop Supplies the Top Two Coffees
Company: Mercor
Role: Software Engineer
Category: Statistics & Math
Difficulty: hard
Interview Round: Technical Screen
Four distinct coffees are ranked by score: two come from shop A and two from shop B. What is the probability that both coffees from A score higher than both coffees from B? Explain your counting argument.
### Constraints
For this exercise, assume scores have no ties and the four coffees are exchangeable, so all 4! strict rankings are equally likely. Independent samples from the same continuous score distribution satisfy this assumption. Fair scoring alone should not be treated as proof that different shops have identical score distributions.
### Clarifying Questions
- Are ties possible, and does better mean strictly higher?
- Are all strict rankings equally likely, or do the shops have different score distributions?
```hint Choose which positions belong to shop A
You can count labeled rankings or count the two ranking positions occupied by A's coffees, as long as the sample space is consistent.
```
### What a Strong Answer Covers
- The equal-likelihood assumption and the event that A occupies the top two positions.
- A correct favorable-to-total count without double-counting.
- An explanation of how ties or unequal score distributions change the problem.
### Follow-up Questions
- What is the probability that either shop occupies both top positions?
- How would the counting argument generalize to m coffees from A and n from B?
Overview: Compute the probability that two coffees from one shop outrank both from another under an explicit exchangeable no-ties model.
Find the Probability That One Shop Supplies the Top Two Coffees
Mercor
Sep 3, 2026
hardSoftware EngineerTechnical ScreenStatistics & Math
0
0
Four distinct coffees are ranked by score: two come from shop A and two from shop B. What is the probability that both coffees from A score higher than both coffees from B? Explain your counting argument.
Constraints
For this exercise, assume scores have no ties and the four coffees are exchangeable, so all 4! strict rankings are equally likely. Independent samples from the same continuous score distribution satisfy this assumption. Fair scoring alone should not be treated as proof that different shops have identical score distributions.
Clarifying Questions Guidance
Are ties possible, and does better mean strictly higher?
Are all strict rankings equally likely, or do the shops have different score distributions?
What a Strong Answer Covers Guidance
The equal-likelihood assumption and the event that A occupies the top two positions.
A correct favorable-to-total count without double-counting.
An explanation of how ties or unequal score distributions change the problem.
Follow-up Questions Guidance
What is the probability that either shop occupies both top positions?
How would the counting argument generalize to m coffees from A and n from B?