In this article
  1. Before you start
  2. Why interviewers ask this
  3. Designing ML for healthcare from first principles
  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

This page is part of the machine learning system design guide, and the metrics are explained on the confusion matrix page.

Why interviewers ask this

Healthcare is the domain where a generic machine learning design fails in specific, checkable ways. The interviewer wants to see that you know the data is regulated, the labels are late and noisy, the patients differ by hospital, and a wrong alert has a human cost. It appears as drift monitoring for a clinical model, genomic pipelines, matching patients to research studies and multimodal models over notes and variants.

A weak answer names a model and a cloud service. A strong answer starts with who acts on the output, counts the false alarms, treats privacy as a design constraint and explains how the model is validated at each site and updated safely. The neighbouring topics are distribution shift, since each hospital is a new distribution.

Designing ML for healthcare from first principles

In plain words

Positive predictive value
Positive predictive value is the share of a model's positive alerts that are true cases, so it answers "when the alert fires, how often is it right?" and depends on how common the condition is.
Calibration
Calibration is the match between a model's stated risk and what happens: among patients scored at 10 percent risk, about one in ten should truly have the condition.

Think of a triage nurse who has worked one hospital for years. She knows what a normal reading looks like there, who needs a second look and how many calls the ward can take. Move her to another hospital with different equipment and a different patient mix, and her instincts need rechecking. A model is the same: it learns one site's normal. The analogy breaks in one place, because a model cannot say it is unsure unless you build that in.

In one sentence, a healthcare ML system is a model plus the checks that show it is lawful, useful and safe for each hospital and each update.

Step 1: Define the clinical decision and the cost of errors

The first step writes down who acts on the output and what each kind of error costs. The input is the clinical question, such as "flag patients likely to deteriorate within a day"; the output is a decision, an owner, an action and a ranking of errors. A missed case and a false alarm cost different amounts, and a ward that can review only a few alerts a shift sets a hard limit on how many the system may send.

Decide whether the model advises a clinician or acts alone, because that changes the risk and the regulation. Choose a label that is available when you need it: a diagnosis code entered days later may differ from what clinicians knew at the time. What you now know: the decision, the owner and the error costs set every threshold later.

Step 2: Get the data lawfully and keep it de-identified

The second step builds the dataset under privacy rules. US regulation, in Title 45 of the Code of Federal Regulations (CFR), names two ways to de-identify health data: expert determination, where a qualified person documents that the risk of identifying anyone is very small, and Safe Harbor, which removes 18 listed types of identifier (45 CFR 164.514). Safe Harbor removes street address, city and county, and keeps only the year of a date. It keeps three ZIP (postal) code digits only for areas above 20,000 people.

Removing obvious fields is not enough when what remains can be combined. Sweeney found that 87 percent of the US population, 216 million of 248 million people, was unique on five-digit ZIP code, gender and date of birth (Sweeney, 2000). A synthetic population of 100,000 shows the mechanism: sex plus birth year leaves nobody unique, adding a ZIP code still leaves nobody unique, and adding the full birth date makes 95.7 percent unique.1 What you now know: privacy is a property of the combination of fields, so list the quasi-identifiers before release.

Step 3: Count the alerts before you build

The third step turns a model's accuracy into the alerts a ward will actually receive. The input is the model's sensitivity and specificity and the condition rate; the output is the positive predictive value and the alerts per true case. Positive predictive value follows from Bayes' rule, where sens is sensitivity, spec is specificity and r is the condition rate:

PPV=sens·rsens·r+(1−spec)(1−r)

The formula shows why the same model performs differently by ward: the false-alarm term grows with the number of healthy patients. With sensitivity 0.80 and specificity 0.90, and a condition rate of 2 percent, 1,000 patients produce 114 alerts of which 16 are true, so positive predictive value is 14.0 percent and a clinician sees 7.1 alerts for every real case.1 The alert burden is arithmetic done before any model exists. A published case shows the stakes: an external validation of a widely deployed sepsis model covered 38,455 hospitalizations, 2,552 with sepsis, and reported an AUC of 0.63 and an alert, a score of 6 or higher, in 6,971 hospitalizations, or 18 percent (Wong et al., 2021).

Step 4: Validate on the patients and sites it will serve

The fourth step tests the model where it will run, not where it was built. The input is a held-out sample from each target site; the output is the ranking quality, the calibration and the alert rate per site. Ranking quality can look fine while calibration breaks, so report both. Size the sample by the positives, because sensitivity is estimated only from them. The Wald interval for a proportion gives the number of positives n needed for a margin of error h, with z of 1.96 (illustrative, for 95 percent confidence) and p the sensitivity you expect:

n=z2p(1−p)h2

For p near 0.80, a margin of plus or minus 0.10 needs 62 positives and plus or minus 0.05 needs 246, so at a 2 percent condition rate that is 3,100 and 12,300 patients.1 Validate again after any change to the lab, the device or the patient mix. What you now know: a validation plan states the sample, the metrics and the site.

Step 5: Deploy, monitor and update under regulation

The fifth step runs the model in the clinic and keeps it safe. The input is live patient data; the output is monitored predictions, a feedback path and a controlled way to change the model. Monitor the inputs, the score distribution, the alert rate and, when labels arrive, the calibration, and compare each against the validated baseline. Label delay means input and alert-rate checks come first; the anomaly-detection design page and machine learning operations (MLOps) practice cover the machinery.

For a model regulated as a device, the US Food and Drug Administration (FDA) describes a predetermined change control plan: a plan submitted with the marketing application that lists planned modifications, the method to develop and validate them and an assessment of their impact, so that each planned change does not need a new submission (FDA guidance, August 2025). What you now know: decide the update rules before launch, not after the first drift.

A healthcare ML system is designed in five stepsFlow of five steps: define the clinical decision and the cost of errors, get the data lawfully, count the alert burden, validate on the patients and sites served, then deploy, monitor and update under regulation.Decisionwho acts, costDatalawful,de-identifiedAlert burdenBayesarithmeticValidateeach siteOperatemonitor, updateDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/design-ml-for-healthcare.html

The alert burden in step three is arithmetic you can do before any model exists.CC BY 4.0 — source: How do you design ML for healthcare?
Step-by-step description
  1. Name who acts and what errors cost.
  2. Use only data the hospital may lawfully use.
  3. Count the false alarms before building.
  4. Test on the sites and patients served.
  5. Monitor drift and change under rules.
  • The alert burden in step three is arithmetic done before any model exists.
  • Validation and monitoring repeat for every site and every update.

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 first example reuses Step 3 with illustrative inputs: a model with sensitivity 0.80 and specificity 0.90 screening 1,000 patients at three condition rates.1

The same model sends 7.1 alerts per true case at a 2 percent condition rate and 2.1 at 10 percent, and its positive predictive value rises from 14.0 to 47.1 percent.
Quantity per 1,000 patients2 percent5 percent10 percent
Alerts sent114135170
True alerts164080
Positive predictive value14.0%29.6%47.1%
Alerts per true case7.13.42.1
Cases missed41020
The same model is right far more often at a higher condition rateBars of positive predictive value for a model with sensitivity 0.80 and specificity 0.90 at condition rates of 2, 5 and 10 percent: 14.0, 29.6 and 47.1 percent.Alerts that are true cases (percent)02040602 percent5 percent10 percentCondition rate in the screened patients1429.647.1Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/design-ml-for-healthcare.html
Only one alert in seven is a true case at a 2 percent condition rate, with an unchanged model.CC BY 4.0 — source: How do you design ML for healthcare?
Text description of the diagram
  • Positive predictive value is 14.0 percent at a 2 percent condition rate, 29.6 percent at 5 and 47.1 percent at 10.
  • The model's sensitivity and specificity are the same in all three cases.

The second example moves one model across three synthetic sites of 30,000 patients each. The model is a logistic regression on one lab value, fitted on site A, with the alert threshold fixed so that 90 percent of healthy patients stay quiet at site A. Site B's assay reads half a standard deviation higher, and site C's lab adds noise.1

A higher assay leaves the AUC unchanged but doubles the alert rate and inflates the predicted risk, and a noisier lab lowers the AUC to 0.734.
SiteAUCAlert rateMean predicted riskObserved rate
A, new patients0.83014.4%9.71%9.77%
B, assay reads higher0.83428.5%16.14%9.98%
C, noisier lab0.73422.9%13.87%9.69%

The AUC gap between A and B is sampling noise: a constant offset in the lab value leaves the ranking unchanged. What breaks at site B is calibration, since the model predicts 16.1 percent average risk where 10.0 percent happens, and the fixed threshold flags twice as many patients.1 At site C the extra noise lowers the AUC and also widens the spread of scores, so more patients cross the fixed threshold and the average predicted risk again exceeds what is observed.

At two new sites the model's average risk no longer matches realityGrouped bars for new site-A patients, site B whose assay reads higher, and site C with a noisier lab: mean predicted risk is 9.7, 16.1 and 13.9 percent against observed rates of 9.8, 10.0 and 9.7 percent.Percent05101520A, newB, assayC, noisy labSite (30,000 synthetic patients each)Mean predicted riskObserved rate9.7116.1413.879.779.989.69Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/design-ml-for-healthcare.html
A shifted lab assay leaves the ranking intact but breaks the calibration and doubles the alerts.CC BY 4.0 — source: How do you design ML for healthcare?
Text description of the diagram
  • At site B the mean predicted risk is 16.1 percent against 10.0 percent observed, and alerts rise from 14.4 to 28.5 percent.
  • At site C a noisier lab lowers the AUC from 0.830 to 0.734.

Trade-offs and edge cases

The design trades sensitivity against alert volume, and model power against validation cost.

  • Threshold and workload. A lower threshold finds more cases and floods the ward. Set it from the review capacity of Step 1, not from a default.
  • Recalibrate or revalidate. A new site with a shifted lab can often be fixed by recalibrating the score, but the change is itself a model update and needs the same validation and, for a regulated device, the plan from Step 5.
  • Late and noisy labels. A diagnosis code can arrive days later and reflect billing as much as truth, so monitor inputs and alert rate while waiting for labels; the real-time fraud detection design faces the same delay.
  • Rare conditions. With a condition rate of 1 percent, validating to plus or minus 0.10 on sensitivity needs about 6,200 patients, so a single hospital may not have enough.
  • Privacy and utility. Removing fields lowers re-identification risk and may remove the signal; weigh Safe Harbor against expert determination.
  • Explanations. A clinician who cannot see why a patient was flagged may ignore the alert; show the main inputs next to the score.

How to answer it in an interview

Interviewer asks

How would you design a machine learning system for a hospital?

A strong answer

I would start with the clinical decision: who acts on the output, what a miss and a false alarm cost, and how many alerts a ward can review. Then I would check the data is lawfully de-identified, validate on each target site and report calibration and alert rate, not just AUC. At a 2 percent condition rate, a model with 0.80 sensitivity and 0.90 specificity is right on only one alert in seven, so I would size the threshold to workload. After launch I would monitor drift and change the model only under an agreed plan.

The spoken structure is: the decision, the data, the alert arithmetic, per-site validation, then monitoring and updates.

Common mistakes

  1. Choosing the model first. (wrong) "I would fine-tune a transformer on the notes." (right) Define the decision, the owner and the cost of errors, then pick the simplest model that works.
  2. Quoting sensitivity alone. (wrong) "The model catches 80 percent of cases." (right) Add the condition rate and say how many alerts per true case a clinician will see.
  3. Treating removed names as de-identified. (wrong) "We dropped the names, so it is anonymous." (right) Check the combinations of ZIP code, dates and sex that remain.
  4. Reporting AUC as site validation. (wrong) "AUC is the same at the new hospital, so it transfers." (right) Check calibration and alert rate too; a shifted assay keeps the AUC and breaks both.
  5. Shipping updates without a plan. (wrong) "We retrain monthly." (right) State the allowed changes, how each is validated and who approves it before launch.

Follow-up questions

How would you design a system to monitor model drift and data quality issues for a model deployed in an active clinical setting?

Track input distributions, missing-data rates, the score distribution and the alert rate against the validated baseline, and compare calibration as labels arrive. Alert a named owner on a sustained change and keep a rollback to the last validated version.

How would you design a pipeline to ingest, preprocess and run inference on high-throughput genomic sequencing data?

Treat it as a staged, restartable workflow: quality control of raw reads, alignment and variant calling, then feature extraction and inference, with each stage versioned and its output stored. Keep identifiers apart from sequence data and record the pipeline version with every result.

How would you design a service that matches patients to research studies using genomic and clinical criteria?

Turn each study's criteria into structured rules, match them against de-identified patient features and return a ranked list with the reasons. Send uncertain matches to a coordinator rather than deciding automatically.

How would you design a multimodal model that combines clinical text with genomic variants?

Encode each modality separately, fuse the representations, and handle missing modalities explicitly, since many patients have notes but no sequencing. Evaluate on patients with each combination of inputs, not only on those with everything.

What changes when the regulator treats the model as a medical device?

Changes need evidence and a plan. A predetermined change control plan lists the planned modifications and how each is validated, so approved updates do not each need a new submission.

Key takeaways
  • Define the clinical decision, its owner and the cost of errors before choosing a model.
  • Privacy is about combinations: in a synthetic population, ZIP code plus full birth date made 95.7 percent of people unique.
  • Quote alert volume: the same model gave 7.1 alerts per true case at a 2 percent condition rate and 2.1 at 10 percent.
  • Validate at each site and report calibration and alert rate, because a shifted assay kept the AUC and doubled the alerts.
  • Agree the update rules, including any regulator-approved change plan, before launch.

Sources

  1. 45 CFR 164.514: Other requirements relating to uses and disclosures of protected health information — Legal Information Institute, Cornell Law School (regulation text; page undated; read 2026-10-25), 25 Oct 2026
  2. Simple Demographics Often Identify People Uniquely (Data Privacy Working Paper 3) — Carnegie Mellon University, Sweeney (2000), 1 Jan 2000
  3. Marketing Submission Recommendations for a Predetermined Change Control Plan for Artificial Intelligence-Enabled Device Software Functions — U.S. Food and Drug Administration (final guidance, August 2025), 1 Aug 2025
  4. External Validation of a Widely Implemented Proprietary Sepsis Prediction Model in Hospitalized Patients — JAMA Internal Medicine (Wong et al., vol. 181, no. 8), 21 Jun 2021