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
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.
When to use and when not to
| Situation | Do this | Watch for |
|---|---|---|
| Rare-event alert | Compute the posterior at production prevalence | Accuracy on a balanced set hides false positives |
| Replicas sharing infrastructure | Model the shared cause, estimate joint failure from incidents | Multiplying per-replica figures assumes independence |
| Skewed latency | Report percentiles; bootstrap when the CLT is slow | Mean and normal intervals mislead on heavy tails |
| Fleet p95 across shards | Merge histograms, compute the percentile once | Averaging per-shard percentiles has no meaning |
| Causal question from logs | Randomised experiment | Adding controls can add collider bias |
Traps interviewers probe
- 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%.
- 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.
- 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.
- 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.
- 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.
- State the sample space and the condition being asked about.
- Write the formula and substitute the numbers.
- Give the answer with its base rate or interval.
- 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.