Skip to content
Tech Interview Prep
Technical interview guide

Machine Learning in Computational Biology

Where ML is actually applied in genomics and drug discovery, and the specific data challenges (class imbalance, batch effects, limited labels) that make biological ML harder than typical tabular or image tasks.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v5
Editorial status
Reviewed

Scope: scikit-learn 1.9 cross-validation, pipeline, evaluation and calibration guidance; DeepVariant, AlphaFold and Enformer source work; TRIPOD+AI, PROBAST+AI, Model Cards and Datasheets guidance reviewed 2026-09-04.

Overview

Curated: · Written: · Reviewed:

Machine Learning in Computational Biology

In one line

Predict a biological label from high-dimensional, related data, and report only the performance on units the deployed model will actually meet. Reach for it when the task is sequence, expression, structure, molecule or imaging prediction with a stated downstream decision.

Key definitions

  • Unit of independence: the thing that must not straddle the train/test boundary (donor, homology cluster, chromosome, scaffold, batch, date).
  • Leakage: any test-side information reaching training, including fit-dependent preprocessing, homologs, or batch-correlated labels.
  • Pseudoreplication: counting cells or windows from one donor as independent samples.
  • Calibration slope and intercept: how observed risk tracks predicted risk. Slope near 1 and intercept near 0 are the target.
  • Precision at k and enrichment: positives in the top k divided by k, compared with the prevalence baseline.
  • Nested cross-validation: outer folds score the whole selection procedure, inner folds do the tuning.

Formulas and complexity

PPV=TPR πTPR π+FPR (1−π)\text{PPV} = \frac{\text{TPR}\,\pi}{\text{TPR}\,\pi + \text{FPR}\,(1-\pi)}

At prevalence pi = 0.01, TPR 0.90 and FPR 0.01: PPV = 0.009 / 0.0189, about 48%. Of 50,000 accounts, roughly 15% of flagged accounts are fraud at TPR 0.90 and FPR 0.05, so the threshold decides the answer.

Newsvendor critical ratio for a weekly order with shortfall cost 40 and leftover cost 10:

cundercunder+cover=4050=0.8\frac{c_{\text{under}}}{c_{\text{under}} + c_{\text{over}}} = \frac{40}{50} = 0.8

Order at the 80th percentile of the predictive distribution.

How it works

  1. Define the unit of independence and the deployment population before choosing a model.
  2. Split on that unit (whole clusters, chromosomes with buffers, donors, scaffolds, dates) and assign once.
  3. Fit every preprocessing step, batch correction and feature selection inside the training fold only.
  4. Tune in inner loops, freeze the test set, and report the outer estimate.
  5. Set the threshold on development data from costs and capacity, then check calibration and subgroups before deployment.
Define deployment unit Split by unit of independence Fit preprocessing inside train fold Nested tuning on development data Freeze threshold, test once Calibration, subgroup and external checks

When to use and when not to

SituationPreferWhy
Hundreds of samples, engineered featuresRegularized linear model or boosted treesFast, interpretable, often competitive
Long raw sequence or image, enough independent dataDeep modelLearns motifs and structure
Few labeled proteinsPretrained embeddings with a logistic-regression baseline on a cluster splitTransfer helps only if pretraining did not see your test homologs
Deployment on new donors or sitesDonor- or site-held-out splitMatches the actual question
Rare positives, limited follow-upPrecision at k, AUPRCAUROC is dominated by true negatives
Causal claimPrediction model aloneAttribution is not causation

Traps interviewers probe

  1. Random split over related rows (cells, windows, homologs). Fix: split by donor, chromosome or a 30% identity cluster, and name the split in the report.
  2. Scaling, imputation or feature selection on the full dataset. Fix: put them in a Pipeline so each is refit per training fold.
  3. Reusing the test set after tuning. Fix: score it once; use nested CV when data are too small for a fixed validation set.
  4. Batch or site as a shortcut. Fix: hold out a batch and check whether batch is confounded with label. If treatment and batch are confounded, batch correction removes the biology too.
  5. Reading AUROC as precision. Fix: report precision, PPV and calibration at the frozen threshold.

Interview tips

Open with: "The number depends on the split, so first I need the unit of independence and the deployment population."

Expected follow-ups:

  • Why did accuracy fall after clustering? The model did not change. The earlier number measured recall of near-duplicates.
  • At 1% prevalence with 50 follow-up slots, which metric? Precision at 50 against a random baseline of about 0.5 expected hits, plus calibration if the list drives capacity.
  • When not to use a pretrained protein model? When tabular features already carry the signal, or when the pretraining corpus overlaps your test homologs.
  • Are 3D displacement heads equivariant? A displacement vector must rotate with the input (Δr_i maps to R Δr_i, translation cancels), and a scalar energy such as ΔG must stay unchanged.

30-second outline: name the unit and the split; state the leakage risk and its fix; give the number with its baseline and calibration; name how the threshold was set and which external check remains.

Feedback on this overview

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