Skip to content
Tech Interview Prep
Technical interview guide

Probability Distributions

The handful of named distributions (normal, binomial, Poisson) that show up repeatedly, and what each models.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v7
Editorial status
Reviewed

Scope: Standards and library references current as of 2026-09: NIST/SEMATECH e-Handbook, SciPy, NumPy, statsmodels, and scikit-learn.

Overview

Curated: · Written: · Reviewed:

Probability Distributions

In one line

Choose the distribution from the process that generates the data, then check the tail, because alerts and capacity are set in the tail. Binomial counts successes in fixed trials, Poisson counts events at a constant rate, exponential measures the wait between them, normal fits sums of small effects, and log-normal fits products of effects. Use negative binomial when counts are over-dispersed.

Key definitions

  • Generating mechanism: the process that produces the observations. It justifies a family; the histogram shape does not.
  • Density: a continuous curve whose value can exceed 1. Probability is its integral over an interval, and any exact value has probability zero.
  • Over-dispersion: variance above the mean. It breaks the Poisson assumption.
  • Memoryless: P(T > s + t | T > s) = P(T > t). Only the exponential has this property.
  • Censored observation: a value known only to exceed a limit, such as a timeout.
  • Tail index: the power-law exponent α. Below 2 the variance is infinite.

Formulas and complexity

P(N=0)=e−λtP(N=0)=e^{-\lambda t}

No event in a window of length t for a Poisson process. The exponential survival function has the same form.

P(any of k independent events)=1−(1−q)kP(\text{any of } k \text{ independent events})=1-(1-q)^{k} Var(N)=μ+μ2r\mathrm{Var}(N)=\mu+\frac{\mu^{2}}{r}

Negative binomial with shape r. It reduces to Poisson as r grows.

median=eμ,mean=eμ+σ2/2\mathrm{median}=e^{\mu},\qquad \mathrm{mean}=e^{\mu+\sigma^{2}/2}

Log-normal, where μ and σ are the mean and standard deviation of log X.

μS=nμ,σS=n σ\mu_S=n\mu,\qquad \sigma_S=\sqrt{n}\,\sigma

Sum of n independent stages. For 100 calls with mean 8 ms and SD 6 ms: mean 800 ms, SD 60 ms.

n∝1−ppn\propto\frac{1-p}{p}

For ±10% relative precision at 95%, n = z²(1−p)/(0.01p). This gives about 1,540 at p = 0.2 and about 18,800 at p = 0.02.

L=λWL=\lambda W

Little's law: mean requests in flight equal arrival rate times mean latency.

How it works

  1. Name the mechanism: fixed trials, events at a constant rate, waiting, or additive or multiplicative effects.
  2. Map it to the family and name the one property to test: equal mean and variance for Poisson, memorylessness for exponential, constant p and independence for binomial.
  3. Estimate parameters, then confirm the library convention. SciPy's expon takes scale = 1/rate.
  4. Check the tail with a Q-Q plot or the empirical CDF. A goodness-of-fit test on large samples rejects every model, so it measures detectability, not adequacy.
  5. Decide from the quantile you need, using the fitted model's quantile or the empirical one with an interval. Never use mean + k·SD for a skewed or heavy-tailed quantity.
fixed trials counts at constant rate yes no, over-dispersed waiting time yes no Counting or waiting? Binomial Variance equals mean? Poisson Negative binomial Memoryless? Exponential Weibull or log-normal

When to use and when not to

DistributionUse whenFails whenCheck
Binomialfixed n, independent trials, constant pp varies or trials correlatevariance n·p·(1−p)
Poissonconstant-rate countsarrivals clustervariance ≈ mean
Negative binomialover-dispersed countsunderlying rate is truly constantvariance = μ + μ²/r
Exponentialwaits with constant hazardhazard changes with age, long service tailsmean = scale
Normalsums of many small effectsskew or heavy tails, as in latencyQ-Q tail check
Log-normalpositive multiplicative effectsthe data mixes populationsreport the median
Heavy tail (α < 2)extreme values dominatenever for a CLT-based intervaltail index first

Traps interviewers probe

  1. Poisson for clustered counts. A variance of 3× the mean means arrivals cluster, and Poisson intervals come out too narrow. Fix: compare variance with mean and switch to negative binomial.
  2. Reading a density as a probability. For rate 10, f(0.2) = 1.35 is a density, not a probability. P(gap > 0.2 s) = e^{-2} ≈ 0.135, and P(gap = 0 s) = 0. Fix: integrate over an interval.
  3. mean + 2.33·SD for heavy tails. At α = 1.5 the variance is infinite, so the sample SD does not settle as n grows and one extreme point can dominate. Fix: check the tail index first, then use an empirical quantile with a bootstrap bound or a tail model.
  4. Timeouts recorded as measurements. Storing 30 of 1,000 requests as 5,000 ms makes p99 = 5,000 ms, which is only a floor. Fix: record censoring and use survival methods.
  5. One seeded RNG shared by workers. Identical seeds produce identical streams, so pooling duplicates the draws and understates the standard error. Fix: spawn child generators with rng.spawn and record the seeds.

Interview tips

Open with the mechanism and the family in one sentence, then name the test you would run on it.

Follow-ups to expect:

  • Does variance equal the mean? If not, what model replaces Poisson?
  • Does memorylessness hold for this service? A disk that has run 3,000 hours still has a 37% chance (e^{-1}) of surviving the next 1,000 under an exponential model, so an exponential model gives no reason to replace it early.
  • Is the variance finite? If not, the CLT interval is invalid.
  • With 100 independent backends at 1% slow each, 1 − 0.99^100 ≈ 63% of requests exceed 100 ms end to end, so the end-to-end p99 is not the stage p99.

30-second answer: "These are per-window counts at a roughly constant rate, so Poisson is my first model, and I check mean against variance. If variance is well above the mean, arrivals cluster, so I use a negative binomial. For the threshold I take the p99 from the fitted quantile, check it against the empirical p99, and report the interval. I don't use mean plus 2.33 standard deviations. Before running anything I confirm the library's parameter convention."

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.