Tech_Interview_Prep

Probability Fundamentals

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

Core definitions

A probability is a number in [0, 1] representing how likely an event is. P(A and B) = P(A) · P(B) only when A and B are independent — otherwise you need P(A and B) = P(A) · P(B|A), conditional on A having occurred.

Bayes' theorem

P(A|B) = P(B|A) · P(A) / P(B)

Lets you flip a conditional probability around — "given the test was positive, what's the probability of having the disease?" — starting from "given the disease, what's the probability of a positive test?" (which is usually the number you actually have, from test validation data).

Common pitfall: base rate neglect

A test that's 99% accurate on a disease affecting 1 in 10,000 people still produces far more false positives than true positives in absolute terms — because the disease is so rare, the 1% false-positive rate applied to the huge "doesn't have it" population outweighs the true positives from the tiny "has it" population. Bayes' theorem makes this precise instead of relying on intuition.

Why it's the root

Distributions, hypothesis testing, and regression all build formal machinery on top of these basic probability rules.