Skip to content
Tech Interview Prep
Technical interview guide

Probability Fundamentals

Events, conditional probability, and Bayes' theorem: the building blocks every statistical method assumes.

Minutes to read
3
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, the 2016 ASA statement on p-values, SciPy, statsmodels, and NumPy.

Overview

Curated: · Written: · Reviewed:

Probability Fundamentals

In one line

Probability fundamentals turn a defined sample space into event probabilities, conditional updates and summary statistics. Reach for them whenever a rate, alert, test result or latency figure must be read correctly before a decision.

Key definitions

  • Sample space: the outcomes the generating process can produce. Fix it before computing anything.
  • Conditional probability: P(A|B) = P(A and B) / P(B), a ratio inside the restricted space, undefined when P(B) = 0.
  • Prior (base rate): P(H) before the evidence. It sets the posterior.
  • Independence: P(A and B) = P(A)P(B). It is a claim about the process, not a modelling convenience.
  • Standard error: the standard deviation of a sample statistic's sampling distribution, not of the data.
  • Coverage: the long-run share of intervals from a procedure that contain the true value.

Formulas and complexity

P(H∣E)=P(E∣H) P(H)P(E∣H) P(H)+P(E∣¬H) P(¬H)P(H\mid E)=\frac{P(E\mid H)\,P(H)}{P(E\mid H)\,P(H)+P(E\mid \neg H)\,P(\neg H)} Var⁡(X+Y)=Var⁡X+Var⁡Y+2Cov⁡(X,Y)\operatorname{Var}(X+Y)=\operatorname{Var}X+\operatorname{Var}Y+2\operatorname{Cov}(X,Y) SE=sn,95% half-width≈1.96 snSE=\frac{s}{\sqrt{n}},\qquad \text{95\% half-width}\approx 1.96\,\frac{s}{\sqrt{n}} P(any collision among n ids in space of N)≈1−e−n2/2N≈n22N  (small n2/N)P(\text{any collision among } n \text{ ids in space of } N)\approx 1-e^{-n^2/2N}\approx \frac{n^2}{2N}\ \ (\text{small } n^2/N)

How it works

  • Define the sample space from how the data was generated, then count or multiply inside it.
  • Bayes converts P(evidence | hypothesis) into P(hypothesis | evidence) by weighting with the base rate and normalising over both hypotheses.
  • Independence licenses multiplication. Shared causes (rack, PDU, deploy) break it, and the product then understates joint risk.
  • Means and variances combine by rules. Standard deviations and percentiles do not: pool variances, merge histograms.
Generating process Sample space Events and joint probabilities Condition: divide by P of the condition Posterior or rate at production prevalence

When to use and when not to

SituationDo thisWatch for
Rare-event alertCompute the posterior at production prevalenceAccuracy on a balanced set hides false positives
Replicas sharing infrastructureModel the shared cause, estimate joint failure from incidentsMultiplying per-replica figures assumes independence
Skewed latencyReport percentiles; bootstrap when the CLT is slowMean and normal intervals mislead on heavy tails
Fleet p95 across shardsMerge histograms, compute the percentile onceAveraging per-shard percentiles has no meaning
Causal question from logsRandomised experimentAdding controls can add collider bias

Traps interviewers probe

  1. Reversing the conditioning (prosecutor's fallacy). Fix: name the conditioned quantity and compute P(H | E) with the base rate. A 99%-sensitive test at 1% prevalence with 95% specificity gives P(disease | positive) of about 16.7%, not 99%.
  2. Multiplying correlated probabilities. Fix: name the shared cause and estimate the joint rate from incident history. Three replicas on one PDU that failed twice for 30 minutes each cannot be modelled as 0.001 cubed.
  3. Adding variances without covariance, or averaging standard deviations. Fix: use Var(X+Y) with the 2Cov term, and pool variances weighted by degrees of freedom.
  4. Quoting the data's standard deviation as the uncertainty of the mean. Fix: divide by the square root of n and label the quantity as a standard error.
  5. Judging an SLO by the mean or by averaged p95s. Fix: check the tail directly. If 2% of requests exceed 500 ms, p99 is above 500 ms whatever the mean says.

Interview tips

Opening. "The answer depends on the sample space, so first I'll pin down how the data was generated."

Expected follow-ups.

  • How sensitive is the posterior to the base rate?
  • What would make these events dependent, and how would you measure it?
  • How many samples halve an interval? (Four times as many.)
  • Why does a seeded simulation need its own interval? (Standard error is s over the square root of the replication count.)
  • The interval includes zero: is there an effect? (Not one you can claim at this sample size.)

30-second outline.

  1. State the sample space and the condition being asked about.
  2. Write the formula and substitute the numbers.
  3. Give the answer with its base rate or interval.
  4. Name the assumption most at risk: independence, confounding or sampling.

Feedback on this overview

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