How to Solve Median and Mode Problems
Learn to solve median and mode aptitude problems with clear steps, a worked example, and practice questions with answers.
Expected Interview Answer
The median is the middle value of a sorted dataset (or the average of the two middle values for an even count), and the mode is the value that occurs most frequently β both describe a typical value but neither is affected by extreme outliers the way the mean is.
To find the median, sort the data first, then pick the value at position (n+1)/2 for odd n, or average the two values at positions n/2 and n/2+1 for even n. The mode simply requires tallying frequencies and reporting the highest β a dataset can be unimodal, bimodal, or have no mode at all if every value is unique. Unlike the mean, both median and mode ignore how far outliers are from the center, which makes them robust for skewed data like income or house prices. Interviewers often test whether a candidate remembers to sort before locating the median position, since an unsorted read gives a wrong answer.
- Median resists distortion from extreme outliers
- Mode works even on non-numeric categorical data
- Both require no formula beyond sorting and counting
AI Mentor Explanation
Line up a teamβs individual scores from a match from lowest to highest and pick the middle one β that is the median score, unaffected by one batterβs freak 150 dropping the mean upward. The mode is whichever score value shows up most often across the team sheet, for instance if three players each scored exactly 20. A single huge century skews the average heavily, but it cannot move the median past its middle position, which is exactly why scouts trust median scores over averages when judging squad consistency.
Worked example
Sorted data
- 4, 8, 8, 15, 16, 23, 42
Median (n=7)
- Position (7+1)/2 = 4
- = 15
Mode
- 8 appears twice
- most frequent value
Step-by-Step Explanation
Step 1
Sort the data
Arrange all values in ascending order before doing anything else.
Step 2
Locate the median position
Odd n: position (n+1)/2. Even n: average positions n/2 and n/2+1.
Step 3
Tally frequencies for mode
Count occurrences of each distinct value.
Step 4
Report the most frequent value
The highest-frequency value is the mode; ties give multiple modes.
What Interviewer Expects
- Sorting the data before locating the median
- Correct handling of odd vs even count for median
- Correct frequency tally to find the mode
- Recognizing median/mode resist outliers unlike the mean
Common Mistakes
- Finding the median position without sorting the data first
- Using the wrong position formula for even-count datasets
- Confusing the mode value with its frequency count
- Assuming every dataset must have exactly one mode
Best Answer (HR Friendly)
βThe median is just the middle value once you sort everything, and the mode is whichever value shows up most. Both are useful because a single extreme outlier cannot drag them off center the way it drags a mean. Sort first, count positions carefully for the median, and tally frequencies carefully for the mode.β
Follow-up Questions
- How would you find the median of a large dataset without fully sorting it?
- What does it mean for a dataset to be bimodal, and how do you report it?
- How do median and mode behave differently on a skewed distribution than the mean?
- How would you estimate the median from grouped, class-interval data?
MCQ Practice
1. Dataset: 3, 7, 7, 9, 12. The median and mode are?
Sorted already, n=5, median is position 3 = 7. Mode is 7 since it repeats twice.
2. Dataset: 2, 4, 6, 8. The median is?
Even n=4: average positions 2 and 3 = (4+6)/2 = 5.
3. Which measure is least affected by one extreme outlier value?
The median only depends on the middle position, so an extreme outlier does not shift it much.
Flash Cards
Median for odd n? β Sort, then take the value at position (n+1)/2.
Median for even n? β Average the two middle values at positions n/2 and n/2+1.
What is the mode? β The most frequently occurring value in the dataset.
Why prefer median over mean for skewed data? β Median ignores how far outliers are from center, so it is not distorted by extremes.