A team wants to test a new transformation on a small subset of a huge table, but customer types are very uneven and the test must include enough of each. Which sampling technique fits?
- Exam domain
- Data Operations and Support22% of the exam
- Difficulty
- Medium
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task Statement 3.4: Ensure data quality.
Objective in the exam guide: Describe data sampling techniques.
Sampling makes testing and analysis fast, but a bad sample hides problems. Choosing the right technique keeps small groups visible.
Why D is the answer
Stratified sampling, taking a set share or count from each customer type
Stratified sampling draws from each group, so small groups are still represented.
Remember: Uneven groups in a sample: stratify.
How it works
Sampling picks a subset of data to work with, to save time and cost.
Simple random sampling gives every row the same chance, so rare groups may be missed.
Stratified sampling splits data into groups and samples from each, so every group is represented.
Clues in the question
The words that point to the answer, and what each one tells you.
- Customer types are very uneven
- Rare groups could be missed.
- Enough of each
- Stratified sampling.
In detail
- Simple random samples can miss rare groups.
- Taking the first rows is biased by how the table is ordered.
Side by side with look-alikes
| Technique | Rare groups represented? |
|---|---|
| Stratified | Yes |
| Simple random | Not guaranteed |
| First N rows | Biased |
| Full table | Yes, but slow |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Simple random sampling of 1% of all rowsWrongMost tempting
A random 1% may contain almost none of the rare types.
Why it tempts: Random sampling is the textbook default. But with very uneven groups, a 1% sample may barely include the rare ones.
B. Taking the first 1,000 rowsWrong
The first rows reflect table order, not the population.
C. No sampling, testing on the full table every timeWrong
Full-table tests are slow and costly for each change.
D. Stratified sampling, taking a set share or count from each customer typeRight
Uneven groups in a sample: stratify.
In practice
- Choose strata by the attribute your test or analysis depends on.
Use case
An illustrative scenario, not a real incident.
A team samples 2,000 rows from each of five customer types and catches a bug that only affected the smallest type.
See how it works
xychart-beta x-axis ["Type A", "Type B", "Type C", "Type D", "Type E"] y-axis "Rows in sample" 0 --> 6000 bar [5200, 3000, 1500, 250, 50] line [2000, 2000, 2000, 2000, 2000]
How to read this chart
- The bars are a simple random sample: type E has only 50 rows.
- The line is a stratified sample: 2,000 rows from every type.
- Only the stratified sample has enough type E rows to test properly.