How do you determine the sample size an experiment needs for a target margin of error and confidence level?

Quick Overview

Asks how to compute the sample size needed to reach a target margin of error at a chosen confidence level. It tests inverting the confidence interval formula for means and proportions, choosing a variability estimate, rounding, and adjustments for small or finite samples.

How do you determine the sample size an experiment needs for a target margin of error and confidence level?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

How can you determine the required sample size for an experiment given a target margin of error and a desired confidence level? ```hint Work backward from the interval Write the half-width of the confidence interval as a function of the sample size, then ask which quantity in it you still do not know before collecting any data. ``` ### What a Strong Answer Covers - The link between margin of error, critical value, variability and sample size, solved for the sample size, for both a mean and a proportion - How each input is chosen, including how to estimate the variability before any data exists - Rounding and the small-sample adjustment - How the required sample size scales as the margin shrinks or the confidence level rises ### Follow-up Questions - How does the calculation change when you need a margin of error on the difference between two groups, as in an A/B test? - How is a sample size chosen for precision different from one chosen for statistical power? - What adjustment applies when you sample from a small finite population, or when only part of the sample will respond?

Overview: Asks how to compute the sample size needed to reach a target margin of error at a chosen confidence level. It tests inverting the confidence interval formula for means and proportions, choosing a variability estimate, rounding, and adjustments for small or finite samples.

Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

How can you determine the required sample size for an experiment given a target margin of error and a desired confidence level?

What a Strong Answer Covers Guidance

  • The link between margin of error, critical value, variability and sample size, solved for the sample size, for both a mean and a proportion
  • How each input is chosen, including how to estimate the variability before any data exists
  • Rounding and the small-sample adjustment
  • How the required sample size scales as the margin shrinks or the confidence level rises

Follow-up Questions Guidance

  • How does the calculation change when you need a margin of error on the difference between two groups, as in an A/B test?
  • How is a sample size chosen for precision different from one chosen for statistical power?
  • What adjustment applies when you sample from a small finite population, or when only part of the sample will respond?