Probability That One Customer's Two Coffees Beat Another's Two

Read the full interview experience this question came from →

Quick Overview

A probability puzzle in which two customers each buy two cups of coffee of random quality, and you find the chance that one customer's cups are better than the other's. It tests clarifying what better means, using symmetry over rankings, checking the result a second way, and reasoning about ties and correlated cups.

Probability That One Customer's Two Coffees Beat Another's Two

Company: Mercor

Role: Software Engineer

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

A coffee shop's drinks vary in quality from cup to cup. Customer A and customer B each buy two cups. What is the probability that A's two cups taste better than B's two cups? ```hint Only the order matters Ask whether the answer can depend on how quality is distributed. If it cannot, think about what is left to randomize once you only look at how the four cups rank against each other. ``` ```hint Check it a second way Once you have a number, confirm it with a different argument, for example by following where the single best cup of the four ends up. ``` ### Constraints and Clarifications - Unless the interviewer says otherwise, assume each cup's quality is a continuous random variable and the four cups' qualities are independent and identically distributed. - Take "A's two cups are better than B's two cups" to mean that each of A's cups is better than each of B's cups. Be ready to answer the other readings listed below as well. ### Clarifying Questions - Does "better" mean that each of A's cups beats each of B's cups; that A's better cup beats B's better cup and A's worse cup beats B's worse cup; or simply that A's two cups have the higher total quality? - Is quality continuous, or rated on a coarse scale where two cups can be equally good? If ties are possible, how do they count? - Are the four cups independent, or can cups bought together, for example poured from the same pot, be correlated? ### What a Strong Answer Covers - Pinning down the meaning of "better" and the distributional assumptions before computing - Reducing the problem to the relative ranking of the four cups and using symmetry - A correct count with a clear justification, confirmed by a second method - The answers under the other readings of "better", and a check that they are consistent with each other - How ties, or correlation between cups bought together, would change the result ### Follow-up Questions - Generalize: A buys `m` cups and B buys `n` cups. What is the probability that every one of A's cups beats every one of B's? - Suppose each cup is independently either good, with probability `p`, or bad. What is the probability that both of A's cups are strictly better than both of B's? - Does the answer still hold if each customer's two cups are poured from the same pot, so they are correlated? Which property of the four qualities does the main answer actually need?

Overview: A probability puzzle in which two customers each buy two cups of coffee of random quality, and you find the chance that one customer's cups are better than the other's. It tests clarifying what better means, using symmetry over rankings, checking the result a second way, and reasoning about ties and correlated cups.

Read the full Mercor Software Engineer interview experience this question came from

|Home/Statistics & Math/Mercor
Mercor logo
Mercor
Oct 4, 2026
mediumSoftware EngineerTechnical ScreenStatistics & Math
0
0

A coffee shop's drinks vary in quality from cup to cup. Customer A and customer B each buy two cups. What is the probability that A's two cups taste better than B's two cups?

Constraints and Clarifications

  • Unless the interviewer says otherwise, assume each cup's quality is a continuous random variable and the four cups' qualities are independent and identically distributed.
  • Take "A's two cups are better than B's two cups" to mean that each of A's cups is better than each of B's cups. Be ready to answer the other readings listed below as well.

Clarifying Questions Guidance

  • Does "better" mean that each of A's cups beats each of B's cups; that A's better cup beats B's better cup and A's worse cup beats B's worse cup; or simply that A's two cups have the higher total quality?
  • Is quality continuous, or rated on a coarse scale where two cups can be equally good? If ties are possible, how do they count?
  • Are the four cups independent, or can cups bought together, for example poured from the same pot, be correlated?

What a Strong Answer Covers Guidance

  • Pinning down the meaning of "better" and the distributional assumptions before computing
  • Reducing the problem to the relative ranking of the four cups and using symmetry
  • A correct count with a clear justification, confirmed by a second method
  • The answers under the other readings of "better", and a check that they are consistent with each other
  • How ties, or correlation between cups bought together, would change the result

Follow-up Questions Guidance

  • Generalize: A buys m cups and B buys n cups. What is the probability that every one of A's cups beats every one of B's?
  • Suppose each cup is independently either good, with probability p , or bad. What is the probability that both of A's cups are strictly better than both of B's?
  • Does the answer still hold if each customer's two cups are poured from the same pot, so they are correlated? Which property of the four qualities does the main answer actually need?
Loading comments...