Design an ICD-10 Prediction System for Clinical Records
Company: Ambience
Role: Machine Learning Engineer
Category: ML System Design
Difficulty: hard
Interview Round: Technical Screen
Design a machine learning system that takes a clinical case record and predicts the relevant ICD-10 diagnosis codes.
Explain the prediction target, how you would obtain and prepare training examples, a practical modeling approach, and how you would evaluate and serve the predictions. The case-record format, available labels, deployment scale, and required accuracy are unspecified; state your assumptions instead of assigning arbitrary targets. Explain how the design changes if a case can have several valid codes.
### What a Strong Answer Covers
- A distinction between predicting recorded diagnosis codes and making a new clinical diagnosis, with an explicit single-label or multilabel formulation.
- A data and label pipeline that avoids leaking the target codes into the model input and keeps related patient records out of opposing evaluation splits.
- A baseline and a justified path to a richer model, including handling long records, infrequent codes, and the applicable code-set version.
- Evaluation of incorrect and missing codes, confidence-based review, and traceability from a prediction to its input and model version.
```hint Define the label first
A record can mention historical conditions, ruled-out conditions, and current findings. Decide what the training annotation actually marks as a target before choosing the model output.
```
### Follow-up Questions
- How would you evaluate performance on rare codes when common codes dominate the dataset?
- What would you change if records regularly exceed the model's context limit?
Overview: Design an ICD-10 prediction system for clinical records, covering labels, model choices, rare-code evaluation, long documents, and reviewer feedback.