In this article
  1. Before you start
  2. Why interviewers ask this
  3. What each one is
  4. Worked example
  5. Trade-offs and edge cases
  6. How to answer it in an interview
  7. Common mistakes
  8. Follow-up questions
  9. Sources

Before you start

Why interviewers ask this

A wrong causal claim costs money: a team ships a feature because a metric moved with it, or a model is trusted because two columns line up. Interviewers use the question to see whether you stop at the number or ask what produced it. A weak answer repeats the slogan "correlation is not causation" and ends there.

A strong answer says why the slogan is true, names the usual culprits (chance, reverse direction, a hidden third variable), and says what evidence would settle it. The answer to practise has three parts: define both words in one sentence each, show how a correlation can appear with no causal link, and say which experiment or assumption would justify a causal claim. This page builds all three from zero.

What each one is

Correlation
Correlation is a statistical association between two variables, usually summarised by the Pearson correlation coefficient r, a number from -1 to +1 that measures the strength and direction of a linear relationship.
Causation
Causation is a relationship in which changing one variable, by an intervention, changes the other variable.
Confounder
A confounder is a third variable that influences both of the variables being compared, so that they move together even when neither affects the other.

Correlation in plain words

Correlation says that when one number is high, the other tends to be high too (a positive correlation) or low (a negative one). The Python documentation describes the Pearson coefficient as taking values between -1 and +1 and measuring "the strength and direction of a linear relationship" (Python documentation, read October 2026). A value near +1 means points lie close to an upward line, near -1 to a downward line, near 0 means no straight-line pattern.

The analogy is two walkers on the same road: you can see they move together, but you cannot tell whether one leads, one follows or both are chasing a bus. The analogy breaks in one place. Correlation is a number computed from data, so it is a fact about that data; the story told about it is not, and a new sample gives a slightly different number.

Causation in plain words

Causation answers a different question: what happens if I change this? Judea Pearl puts the dividing line in the kind of question being asked. Standard statistics infers probabilities "under static conditions", while causal analysis also infers what happens "under changing conditions, for example, changes induced by treatments or external interventions" (Pearl, 2009, section 2.1). An intervention is an action that sets a variable to a chosen value from outside the system, such as a coin flip deciding who sees a new page. Pearl's conclusion is that one cannot substantiate causal claims "from associations alone", because behind every causal conclusion lies a causal assumption that observational data cannot test.

How a hidden third variable creates a correlation

A hidden third variable can create a strong correlation between two things that do not affect each other. In a simulation of 365 days, daily temperature drives both ice-cream sales and the number of swimmers, and swimmers drive drowning incidents. Sales never touch an incident. Yet the correlation between sales and incidents is 0.63 across the year. Hold temperature fixed, by comparing only what is left after removing each variable's temperature-related part, and the correlation drops to 0.05. Now simulate an intervention that sets sales independently of the weather: the correlation is also 0.05.1 The data are invented for illustration, but the mechanism is the one that fools analysts with real data. The numbers are in the worked example below.

Correlation describes data while causation predicts what an intervention doesComparison of correlation and causation on four questions: what each claims, what evidence supports it, what happens if you change one variable, and what each can predict.QuestionCorrelationCausationWhat it claimstwo variablesmove togetherchanging onemoves the otherEvidence neededobserved data,one formulaa trial or causalmodelIf you intervenesays nothingpredicts the newoutcomeCost to checkseconds onexisting dataa trial or a modelDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/correlation-vs-causation.html
Correlation summarises what was observed; causation answers what would happen if you changed one variable.CC BY 4.0 — source: Correlation vs causation: what is the difference?
Text description of the diagram
  • Correlation measures the strength and direction of a linear relationship.
  • Causation means an intervention on one variable changes the other.
  • A causal claim needs an assumption that observational data cannot test.

Knowing it is half the job. Saying it is the other half.

Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.

Start Free Trial →

Worked example

The simulation uses 365 days with fixed random seeds. Temperature averages 20 degrees with a spread of 8 (illustrative). Sales rise with temperature, swimmers rise with temperature, and incidents follow swimmers.1 The script then computes the correlation three ways and runs two more checks that every interviewer's follow-up touches: a perfect relationship that shows zero correlation, and how often unrelated data looks convincing.

A hidden common cause makes sales and incidents correlate with no arrow between themCausal diagram of the simulation: temperature drives ice-cream sales and swimmers, swimmers drive drowning incidents, and sales have no arrow to incidents. The observed correlation of 0.63 between sales and incidents falls to 0.05 once temperature is held fixed.Temperaturecommon causeIce-creamsalesSwimmersDrowningincidentsSales vs incidents r 0.63Temperature fixed: r 0.05Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/correlation-vs-causation.html

Every path from sales to incidents runs back through temperature, so holding temperature fixed removes the correlation.CC BY 4.0 — source: Correlation vs causation: what is the difference?
Step-by-step description
  1. Temperature drives sales and swimmers.
  2. Swimmers drive incidents.
  3. Sales and incidents correlate at 0.63, though sales never touch an incident.
  4. With temperature fixed the correlation is 0.05.
  • Temperature drives both ice-cream sales and the number of swimmers.
  • Swimmers drive drowning incidents.
  • Sales never touch an incident, yet the correlation between sales and incidents is 0.63.
  • Holding temperature fixed drops the correlation to 0.05.
Simulated sales and incidents correlate at 0.63 as observed, but at 0.05 once temperature is controlled or sales are set by an intervention.
MeasurementValue (simulated, illustrative)
Correlation of sales with incidents, as observed0.63
Same correlation with temperature held fixed0.05
Same correlation when sales are set independently of temperature0.05
Correlation of x with x squared on symmetric values0.00
Pairs of unrelated 15-step random walks with absolute r of 0.9 or more1.7% of 10,000 pairs
Pairs of unrelated independent noise series with absolute r of 0.9 or more0.00% of 10,000 pairs

The fourth row shows the opposite failure. When x runs from -5 to 5 and y is x squared, y is fully determined by x, yet r is 0.00,1 because the pattern is a curve and Pearson measures only straight lines. The last two rows show that sequences that trend, like random walks, produce striking correlations by luck far more often than independent noise does: 1.7% of pairs reach 0.9 or more, against none for noise. Search enough pairs of trending series and some will look related.

The core of the script is short:

def pearson(x, y):
    mx, my = mean(x), mean(y)
    sxy = sum((a - mx) * (b - my) for a, b in zip(x, y))
    return sxy / sqrt(sum((a - mx) ** 2 for a in x) * sum((b - my) ** 2 for b in y))

r_partial = pearson(residuals(ice, temp), residuals(inc, temp))  # temperature removed

The residuals function removes each variable's straight-line dependence on temperature, which is what "holding it fixed" means for linear relationships here. You can check the 0.05 with a calculator from three correlations the script prints: sales with temperature 0.9062, incidents with temperature 0.6784, sales with incidents 0.6295.1 The partial correlation is (0.6295 - 0.9062 × 0.6784) / √((1 - 0.9062²) × (1 - 0.6784²)) = 0.0147 / 0.3107 = 0.05.

Trade-offs and edge cases

Correlation is cheap and fast; causal evidence is slow and costly. The skill is knowing which question you are answering, and the flow below lists the checks in the order they remove explanations.

Four checks move a correlation toward a causal claimFlow of four checks applied to a correlation: confirm it is not chance, confirm the cause comes first, look for a third variable behind both, and test by intervening.Chance?sample sizeOrdercause firstThirdvariableconfounderIntervenerandomiseDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/correlation-vs-causation.html

Each check removes one non-causal explanation; only an intervention tests the claim directly.CC BY 4.0 — source: Correlation vs causation: what is the difference?
Step-by-step description
  1. Is the pattern more than luck in a small sample?
  2. Does the cause come before the effect?
  3. Does a hidden variable move both?
  4. Change one variable yourself and watch the other.
  • First rule out chance, because many unrelated series look strongly related by luck.
  • The cause must come before the effect.
  • A third variable behind both can create the whole correlation.
  • An intervention tests the claim directly.

The cause must come before the effect, and an intervention tests the claim directly; the other checks only remove rival explanations.

Chance. With few points or trending series, strong correlations appear without any link, as the 1.7% figure shows.1 Reverse direction. The effect may drive the cause: being in hospital correlates with being ill, because illness sends people to hospital, not the reverse. A hidden variable. The ice-cream case above. Nonlinear links. A zero correlation does not mean independence.

When you cannot run an experiment, epidemiology offers a checklist. Austin Bradford Hill (May 1965) listed nine viewpoints for judging whether an association is causal: strength, consistency, specificity, temporality, biological gradient, plausibility, coherence, experiment and analogy. His example for strength was that the death rate from lung cancer in cigarette smokers was nine to ten times the rate in non-smokers (Hill, 1965). He also called them viewpoints, not rules: none of them can bring indisputable evidence on its own, and none "can be required as a sine qua non". Temporality is still the one a causal claim cannot do without, because a cause cannot come after its effect.

Quotable facts for correlation versus causation, each from a cited source or computed in this page's script.
FactValue
Range of Pearson's r-1 to +1
What r measuresstrength and direction of a linear relationship
Simulated sales-versus-incidents correlation0.63 as observed, 0.05 with temperature fixed
Number of Hill's viewpoints (1965)9
Share of unrelated random-walk pairs with absolute r of 0.9 or more (n = 15, simulated)1.7%

For work you can test, the standard route is a randomised controlled trial (RCT): assign the cause by coin flip so no hidden variable can line up with it. In product teams the same design is called an A/B test (A/B testing interview questions). When randomising is impossible, Pearl's route is to write the causal assumptions down as a diagram and compute the effect of an intervention from them, which stays conditional on those assumptions being right.

A propensity score is the estimated probability that a unit receives the cause, given its measured variables; comparing units with similar scores is one way to adjust. An instrumental variable is an outside factor that shifts the cause but affects the outcome only through it.

How to answer it in an interview

Interviewer asks

What is the difference between correlation and causation, and how would you tell which one you have?

A strong answer

Correlation means two variables move together, measured for example by Pearson's r, a linear measure from minus one to one. Causation means changing one variable changes the other. A correlation can come from chance, from reverse direction or from a third variable driving both, so I check those first. To claim causation I want an intervention, ideally a randomised experiment. If I cannot run one, I state the causal assumptions explicitly and say the claim holds only if they do. And a zero correlation does not prove independence, because a U-shaped curve can give zero.

The spoken structure is: one sentence per definition, the three non-causal explanations, then the evidence that would settle it.

Common mistakes

"Correlation never tells you anything about causation." (wrong) It is a useful clue, and where there is a causal link there is usually a correlation. (right) "Correlation alone cannot establish causation, but it tells me where to look."

"Zero correlation means no relationship." (wrong) The curve x squared has r of 0.00 yet is fully determined. (right) "Zero correlation means no linear relationship."

"I controlled for everything, so it is causal." (wrong) You can only control for what you measured, and Pearl shows that adding the wrong variable can increase bias rather than remove it (Pearl, 2009, section 3.3.2); Rosenbaum and Rubin advise adjusting for every pre-treatment variable, so practice differs. (right) "Controlling reduces known confounding; unmeasured confounders remain."

"A very high r proves a strong effect." (wrong) The r measures how tightly points hug a line, not how large the effect is. (right) "r gives tightness; the slope gives the size of the effect."

Follow-up questions

Does correlation ever imply causation?

Not by itself. Correlation is evidence that something is going on, but Pearl argues that causal claims need a causal assumption that observational data cannot test (Pearl, 2009); a randomised experiment makes that assumption true by design.

How do you establish causation from observational data?

You establish causation from observational data by writing the causal story as a diagram and adjusting for what it says confounds the comparison. Adjust for measured variables that block every non-causal path from cause to effect, by regression, matching or a propensity score, or use an instrumental variable when one exists (Pearl, 2009, sections 3.3 and 3.5). Then check temporality and report how sensitive the result is to an unmeasured confounder; Hill's nine viewpoints are a checklist for the judgement, not a test that returns yes or no.

Yes: in the worked example y is fully determined by x (it is x squared), yet r is 0.00. Pearson measures only straight-line association, and a rank-based measure such as Spearman's measures only a monotonic one, a curve that only rises or only falls (Python documentation, read October 2026), so it is also 0.00 for this U shape.1 Plot the data first.

What is a confounder, and how do you handle one?

A confounder influences both variables. Handle it by randomising, by adjusting for it in a model if you measured it, or by matching comparable units. See classical machine learning for the models used in adjustment.

What if the correlation is 0.95?

A high r still says nothing about direction or cause. Ask how many points there are, whether the series trend, and what third variable could drive both; in the simulation, 1.7% of unrelated trending pairs reached 0.9.1 For distributions and spread read the Gaussian distribution page, and for how vectors and projections underlie r see linear algebra for machine learning. Classification metrics raise the same question of what a number tells you: confusion matrix and entropy and Kullback-Leibler (KL) divergence.

Key takeaways
  • Correlation measures how two variables move together; causation means changing one changes the other.
  • A correlation can come from chance, reverse direction or a hidden third variable.
  • In the simulation, a correlation of 0.63 fell to 0.05 once temperature was controlled.
  • Zero correlation means no linear relationship, not no relationship.
  • To claim causation, intervene, ideally by randomising, or state the assumptions that justify it.

Sources

  1. The Environment and Disease: Association or Causation? (Proceedings of the Royal Society of Medicine 58(5), 295-300) — Royal Society of Medicine (Austin Bradford Hill), 1 May 1965
  2. Causal inference in statistics: An overview (Statistics Surveys 3, 96-146) — Statistics Surveys (Judea Pearl), 1 Sep 2009
  3. statistics.correlation, Python 3 standard library documentation — Python Software Foundation (date = read date), 24 Oct 2026