In this article
Before you start
This page belongs to the probability and statistics guide, which covers the distributions that decide which summary fits.
Why interviewers ask this
A wrong summary number can mislead a whole decision, and the interviewer wants to see that you check the shape of the data before you summarise it. The question appears in data and machine-learning screens in forms such as "when would you report the median instead of the mean" and "why is average income misleading". Reported in interviews at AI labs and large tech companies, it is often a warm-up that leads into outlier handling, skewed features and metric design.
A weak answer recites the two definitions. A strong answer says which one moves when an extreme value arrives, why, and what you would look at before choosing.
What each one is
- Mean
- The mean is the sum of a set of numbers divided by how many numbers there are. It uses every value, so each value moves it a little.
- Median
- The median is the middle value of a set of numbers sorted in order; with an even count it is the average of the two middle values. It depends on rank, not on how large the extreme values are.
- Outlier
- An outlier is a value that sits far from the rest of the data, such as one very large salary among ordinary ones. It may be a real case or a recording error.
- Skew
- Skew is the lack of symmetry in a distribution. Data with a long right tail is skewed right, and its mean is usually pulled above its median.
The mean in plain words
The mean is the fair-share number: if every value were replaced by the same amount and the total stayed the same, that amount is the mean. The Python statistics documentation (read 2026-10-24) defines it as the sum of the data divided by the number of data points, and warns that it is strongly affected by outliers and is not necessarily a typical example of the data points.
That makes the mean the right tool when totals matter. If you want to know how much a team spends in a month, the total divided by the number of people is meaningful even when a few people spend far more than the rest. The input is every value, and the output is a single number that balances them.
The median in plain words
The median is the middle person in a line: half the values are below it and half above. Sort the values, then take the middle one, or the average of the middle two when the count is even. The same Python documentation says the median is a robust measure of central location, less affected by the presence of outliers, and gives the even case as the average of the two middle values, so the median of 1, 3, 5, 7 is 4.0.
The input is the order of the values, not their size. Replacing the largest value by one a thousand times larger changes nothing, because it is still the largest. The analogy breaks only when you need a total: the median says nothing about the sum.
Which one moves when an extreme value arrives?
The mean moves in proportion to the extreme value, and the median moves by at most one position in the ordering. When one of n values changes by an amount d, the mean changes by d divided by n, with no ceiling on d, while the median can only step to the neighbouring value.
NIST's handbook (section 1.3.5.1, read 2026-10-24) says extreme values in the tails distort the mean but not the median, because the median is based on ranks, and that for data with extreme values in the tails the median provides a better estimate of location. It also says the mean is an optimal estimator if the data are normal. So the choice depends on the shape of the data, which the Gaussian distribution page describes for the symmetric case.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Worked example
Take nine illustrative salaries in thousands: 52, 55, 58, 60, 62, 64, 66, 70 and 75. Their mean is 62.44 and their median is 621. Now one founder's salary of 900 joins, so there are ten values. The mean becomes 146.2, a factor of 2.34 higher, while the median becomes 63, a move of one thousand1. Nine of the ten people, 90 percent, now earn less than the mean.
Text description of the diagram
- The mean of the nine ordinary salaries is 62.44 thousand and the median is 62 thousand.
- After adding one salary of 900 thousand the mean is 146.2 thousand and the median is 63 thousand.
| Fact | Value |
|---|---|
| Mean of the nine ordinary salaries | 62.44 thousand |
| Median of the nine ordinary salaries | 62 thousand |
| Mean after adding one salary of 900 thousand | 146.2 thousand |
| Median after adding the same salary | 63 thousand |
| Mean with the top and bottom 10 percent removed (trimmed mean) | 63.75 thousand |
| Mean and median of 100,000 symmetric draws (normal, mean 50, standard deviation 10) | 50.05 and 50.02 |
| Mean and median of 100,000 right-skewed draws (lognormal, parameters 0 and 1) | 1.644 and 0.998 |
| Share of the skewed draws below their own mean | 68.97 percent |
A trimmed mean is a mean computed after discarding a fixed share of the lowest and highest values; here dropping one value from each end of the ten gives 63.75, close to the median1. The two samples at the bottom of the table are simulated with seed 0. For the symmetric sample the mean and median differ by 0.035, under 0.1 percent1. For the skewed sample, theory gives a mean of about 1.6487 and a median of exactly 1, and the simulation matches at 1.644 and 0.9981. Because the mean sits above the median, about 69 percent of the values fall below the mean, so "the average" overstates what a typical case looks like.
Text description of the diagram
- The mean is 1.00 times the median for the symmetric sample.
- The mean is 1.65 times the median for the right-skewed sample.
Real statistics follow the same logic. The U.S. Census Bureau reports median household income, not mean, as its headline figure: 83,730 US dollars for 2024 in its Income in the United States: 2024 report (published 9 September 2025). Income is right-skewed, and the median is the amount that half of households fall below. The guide on answering salary expectations quotes the same kind of figure, the Bureau of Labor Statistics median pay.
Trade-offs and edge cases
Neither summary is better in general. The mean uses all the data and is the natural choice for symmetric data and for totals, while the median ignores magnitude and is the natural choice for skewed data and for "typical case" questions.
| Dimension | Mean | Median | Trimmed mean |
|---|---|---|---|
| Uses every value | Yes | No, only the order | Most values |
| Effect of one extreme value | Unbounded | At most one step | Small |
| Best for | Symmetric data, totals | Skewed data, typical case | Noisy data with some outliers |
| Needs sorting | No | Yes | Yes |
Four edge cases matter. First, an outlier can be an error: check whether 900 is a typo before choosing a summary, because the right fix for an error is to correct it, not to switch to the median. Second, a skewed distribution may call for reporting both, which the NIST handbook suggests when there is no obvious answer for exponential or lognormal data (section 1.3.5.1).
Third, an even count has no single middle value, so the median is an average of two values that may not exist in the data. Fourth, in machine learning, squared error corresponds to the mean and absolute error to the median, so the loss function chooses the summary your model learns; see choosing a loss, which names absolute error for data with outliers, and the classical machine learning guide.
Skew itself is measured: NIST section 1.3.5.11 says symmetric data should have skewness near zero, with positive skewness meaning a long right tail. A gap between mean and median is a quick hint of skew, not a proof: the order can reverse, especially for discrete data (von Hippel, 2005, Journal of Statistics Education, read 2026-10-24).
Text description of the diagram
- Use the mean when the data are roughly symmetric with few outliers, or when a total is what matters.
- Use the median, with the mean beside it, when the data are skewed or contain outliers.
How to answer it in an interview
What is the difference between the mean and the median, and when would you use each?
The mean is the sum divided by the count, so every value moves it; the median is the middle value after sorting, so only the order matters. That makes the mean sensitive to outliers and the median robust. I would plot the distribution first. If it is roughly symmetric, or I need a total, I use the mean. If it is skewed or has outliers, such as incomes or latencies, I report the median and often the mean alongside it, and I would check whether an outlier is an error before choosing.
The spoken structure is: define both in one breath, say which one outliers move, then give the rule of plotting first and the example of income.
For a data-science round, add one number. Say that one value of 900 among nine values near 62 moved the mean from 62 to 146 and the median from 62 to 63. A figure you computed yourself is more memorable than a rule.
Common mistakes
- "Average means mean" (wrong). In everyday speech average can mean mean, median or the most common value (right: name the statistic you report).
- "The median is always the better choice" (wrong). The median ignores magnitude, so it cannot give a total or a fair share (right: use the mean for totals and for symmetric data).
- "I drop the outlier and use the mean" (wrong). Removing a real value changes the population you describe (right: check whether it is an error, and otherwise report the median or both).
- "With an even count the median is a value in the data" (wrong). It is the average of the two middle values, so 4.0 for 1, 3, 5, 7 (right: say it is interpolated).
- "The mean equals the median, so the data are normal" (wrong). Equal values hint at symmetry; many symmetric shapes are not normal (right: look at the histogram or a normal probability plot).
Follow-up questions
When should you use the median instead of the mean?
Use the median when the data are skewed or contain outliers and you want a typical case, such as income, house prices or response times. Use the mean when the data are roughly symmetric or when a total is what matters.
Is the mean always bigger than the median?
No. For right-skewed data the mean is usually above the median, as in the lognormal sample where 1.644 beat 0.998, for left-skewed data it is usually below, and for symmetric data they are close. The rule has exceptions, especially for discrete data: a Poisson distribution with mean 0.7 has positive skewness of 1.195 yet a median of 1, so its mean is below its median1. Von Hippel (2005) shows the rule fails more often than textbooks suggest.
How do you find the median of an even number of values?
Sort the values and average the two in the middle, so the median of 1, 3, 5, 7 is 4.0. If you need an actual data point, some libraries offer a lower or higher median instead, as the Python documentation notes.
What if the mean and median are equal?
It suggests the distribution is roughly symmetric, so either summary describes the centre equally well. It does not prove normality: other symmetric shapes also give equal values, so plot the data. The same habit appears in feature engineering, where numeric gaps are often filled with the median rather than the mean.
Is there a measure between the mean and the median?
Yes: a trimmed mean discards a fixed share of the lowest and highest values before averaging, as in the example where the 10 percent trimmed mean was 63.75. Computing a median without fully sorting, for example with quickselect or two heaps, is a typical topic in the coding interviews guide.
- The mean is the sum divided by the count, and the median is the middle value after sorting.
- An extreme value moves the mean in proportion to its size; it moves the median by at most one position.
- Right-skewed data usually has its mean above its median, so the mean often overstates a typical case.
- Plot first: symmetric data or totals suit the mean, skewed data or outliers suit the median.
- Check whether an outlier is an error before you change the summary.
Sources
- statistics, Mathematical statistics functions (Python 3.15 documentation: mean and median) — Python Software Foundation (page footer: last updated 2026-10-24), 24 Oct 2026
- 1.3.5.1. Measures of Location, NIST/SEMATECH e-Handbook of Statistical Methods — NIST (page shows no date; read 2026-10-24), 24 Oct 2026
- 1.3.5.11. Measures of Skewness and Kurtosis, NIST/SEMATECH e-Handbook of Statistical Methods — NIST (page shows no date; read 2026-10-24), 24 Oct 2026
- von Hippel, Mean, Median, and Skew: Correcting a Textbook Rule, Journal of Statistics Education 13(2) — American Statistical Association (article dated 2005; read 2026-10-24), 24 Oct 2026
- Income in the United States: 2024 (Current Population Reports P60-286) — U.S. Census Bureau, 9 Sep 2025