The interview problem
Explain why sharing class covariance creates a linear decision boundary.
Original practice, not a reported company interview. Scenarios and numbers are illustrative. Interview date: not applicable. Sources retrieved October 1, 2026.
1. Scope and worked approach
Model each class as Gaussian and add log class priors. With a common covariance, the quadratic term in x cancels between class log densities, leaving a linear discriminant. Separate covariances retain quadratic terms and need more data to estimate.
2. Trace the design or derivation
Class likelihoods and priors → log ratio → cancel shared quadratic → boundary
Do not confuse generative modeling with a guarantee of calibrated probabilities. Evaluate probability quality on held-out data. A discriminative linear classifier may be competitive even when the Gaussian model is wrong; the interview answer should compare assumptions rather than declare one family universally superior.
3. Calculate the example
In one dimension with means 0 and 2, equal priors and common variance 1, the equal-density boundary is x=1. Unequal priors shift the boundary even when the means stay fixed.
4. Failure cases and trade-offs
Gaussian assumptions can fail, and nearly singular covariance matrices need regularization. More flexible boundaries can overfit small classes.
5. Validation, follow-ups and self-review
Derive the shared-covariance cancellation and test imbalanced priors. Follow-up: when would shrinkage help? Self-review: connect assumptions to boundary shape and sample size.
Sources and related practice
Technical reference: scikit-learn.org — Gaussian discriminants and shared versus separate covariance.
Source publication/update: Not established. Retrieved October 1, 2026. The workflow, calculations and review exercises are original; this reference is not evidence that a company asked this question.
Continue with Logistic regression, from score to decision; Stabilize a noisy covariance estimate.
Continue your preparation
Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.