The interview problem

Practice prompt

Design a predictive-maintenance system for 10,000 industrial pumps. Predict bearing failure within seven calendar days and give technicians at least 48 hours to inspect equipment and obtain parts. Historical records contain observed failures, preventive replacements, decommissioned assets and missing telemetry. Explain the prediction target, labels, evaluation and maintenance workflow. Show why a model with good alert precision can still provide poor operational value.

Original ML-design practice, not a reported company interview. Fleet size, calculations and examples are hypothetical. Primary references retrieved September 27, 2026; interview date not applicable.

1. Define the event and the maintenance policy

Start with one failure mode: a confirmed bearing failure in the component installed at the prediction time. Maintain a component episode from installation to replacement or removal. The physical pump retains its identity across episodes, but the replacement bearing starts a new age history.

The initial prediction target is the probability of that failure within seven calendar days among currently operating eligible components under the existing maintenance policy. Operating hours, duty cycle and load are features; they are not interchangeable with the calendar horizon used for technician scheduling.

A different target is the probability that the component would fail if maintenance were withheld. That is a counterfactual quantity. Historical risk under the current policy does not automatically estimate it: the highest-risk equipment may already be removed before failure. State which quantity the model predicts before discussing decision thresholds or prevented failures.

Record competing outcomes, including preventive replacement and other failures that remove the component from service. Missing telemetry is an observation problem; it is not itself proof of a healthy component or a bearing failure. Define the confirmation rules with maintenance specialists and preserve uncertainty when the work order does not establish a cause.

2. Build labels that distinguish censoring from intervention

Consider predictions made at day 0. Features must be available at that time.

Component historyWhat is known at evaluationLabel implication
A fails on day 4Target event observed inside horizonPositive seven-day outcome
B remains observed and operating through day 7No target failure in full horizonNegative seven-day outcome
C is last observed on day 3Later outcome unknownIncomplete follow-up; not a negative
D is preventively replaced on day 2 for high vibrationAn intervention ended this component episodeRecord the competing intervention; do not infer untreated survival
E fails on day 1Target event observed, warning is too latePositive prediction target but insufficient 48-hour lead time

For the observed-policy target, D's replacement can be modeled as a competing event that prevents a subsequent failure of the removed component. If instead the target is natural failure without replacement, treating D as ordinary independent censoring is generally unjustified: its symptoms caused the intervention.

A right-censored record says that the event was not observed up to a known time; it does not supply an exact remaining useful life. Survival methods can use partial follow-up under their assumptions. They do not automatically recover an unobserved counterfactual after preventive maintenance.

Keep event time and data-availability time. A work order opened before prediction may legitimately describe known symptoms. Its final diagnosis, written after failure, is unavailable at prediction and must not leak into features. Backfilled maintenance records require point-in-time reconstruction rather than joining the latest database snapshot.

3. Connect predictions to a maintenance workflow

sensor ingestion → timestamp and sensor-quality checks
                              ↓
rolling features + component registry + maintenance ledger
                              ↓
               versioned risk model and calibration
                              ↓
       alert policy: lead time, priority and crew capacity
                              ↓
               technician inspection and disposition
                              ↓
     outcome/intervention log → delayed labels → evaluation

Compute features from recent vibration, temperature, pressure and load, plus operating age, sensor availability and prior maintenance known at the anchor time. Separate baseline differences between equipment models and operating regimes from changes that suggest degradation.

The serving response includes risk horizon, component identity, model version, data freshness and quality status. Missing or implausible telemetry should produce an explicit unknown or data-quality condition, not a reassuring low-risk score.

Deduplicate repeated threshold crossings into alert episodes, with documented cooldown and escalation rules. Show technicians the affected component, observed changes, relevant history and recommended inspection priority. Record acknowledgement, actual inspection time, parts availability, findings, replacement and outcome.

Keep established engineering safety rules and mandatory inspections active. This advisory model does not override them. A useful failure forecast still requires an available maintenance action and enough time to carry it out.

4. Choose a model compatible with the target

Begin with age-and-load rules and a strong model on rolling summary features. A boosted classifier can estimate a fixed-horizon outcome when labels are observed, but training only on complete cases may select an unrepresentative population. Report that limitation rather than claiming fleet-wide calibration.

A discrete-time hazard model or another survival model can incorporate partial follow-up. For observed failure before replacement, model the relevant competing outcomes rather than interpreting a cause-specific risk score as an unconditional seven-day failure probability. A sequence model is justified only if it improves useful warning performance beyond windowed features at an acceptable operational cost.

Censoring adjustments require assumptions. Conditional weighting needs recorded predictors of observation and adequate follow-up probability in the groups being evaluated. Unrecorded technician judgment can leave informative censoring unresolved. Extreme weights can also make estimates unstable.

The referenced scikit-survival Brier-score implementation estimates censoring with a Kaplan–Meier model that assumes random censoring independent of features. Its weights are not a general correction for maintenance driven by symptoms. The metric also expects survival probabilities and adequate follow-up support, not arbitrary ranking scores.

NASA's referenced aircraft dataset is generated with a simulator using real flight-condition inputs. It can support method development, but success on simulated run-to-failure trajectories does not demonstrate benefit in a pump fleet where maintenance changes the outcomes.

5. Evaluate by asset and time

Do not randomly split sensor rows. Adjacent windows from the same degrading component can be almost identical, and a model may recognize an asset rather than generalize to a new failure trajectory.

Use a forward-time evaluation for future behavior on the installed fleet, with features frozen at prediction and enough time for labels to mature. Separately evaluate held-out pumps or sites for transfer to new installations. Keep replacement episodes grouped by physical asset where the evaluation requires unseen equipment. State which deployment each split represents.

Fit normalization, imputation, feature selection and calibration only on permitted training data. Exclude future maintenance outcomes from features and preserve delayed record availability. Report slices by equipment model, site, load regime, component age and missing-data rate.

Measure calibration and discrimination at the actionable horizon, with censoring-aware metrics only where assumptions support them. Also measure alert burden, lead-time distribution and observed failure coverage. A concordance ranking alone does not tell the maintenance team whether there is enough time to order a part. For the competing-event target, evaluate predicted failure cumulative incidence with an appropriate competing-risk metric; the ordinary single-event survival Brier score cited below is not automatically interchangeable.

6. Convert prediction quality into actionable coverage

Run a shadow evaluation: the new model does not trigger interventions, while the established maintenance policy continues. Freeze the alert-episode rules. In an illustrative fully resolved evaluation cohort, there are 100 distinct alert episodes and 80 observed target failures. Sixty alerts precede distinct failures within seven days. Of those, 40 provide at least 48 hours of warning and 20 provide less.

episode precision for observed failure = 60 / 100 = 60%
observed failure coverage = 60 / 80 = 75%
actionable failure coverage = 40 / 80 = 50%
timely failure-positive alerts / all alerts = 40 / 100 = 40%

Despite 75% coverage of observed failures, only half of those failures receive the required lead time. Count each failure once under a predefined matching rule. Repeated hourly alarms before one failure must not become dozens of true positives.

The other 40 alerts have no observed target failure in the defined evaluation outcome. Some may have been followed by preventive replacement under the established policy. Report that subset separately: these outcomes are not evidence that the component would have remained healthy without maintenance. Records with genuinely unresolved follow-up are excluded from this simple arithmetic and must be reported, not silently relabeled negative.

The counts describe the resolved cohort under its existing policy. Generalizing them to the entire fleet requires addressing censoring and selection. Estimate uncertainty with the dependence structure in mind, for example resampling whole assets or sites rather than treating every overlapping sensor window as independent.

7. Keep decision economics separate from predicted risk

As an original simplified decision example, suppose an inspection-and-action package costs 200 units, a failure costs 20,000 units and the package prevents 70% of otherwise occurring failures. Assume no additional action cost or harm for this calculation. Let p be failure probability without that package.

expected net benefit = p × 0.70 × 20,000 − 200
beneficial when p > 200 / 14,000
threshold = 1/70 ≈ 0.014286

The threshold is about 1.43%. It follows from hypothetical causal effectiveness and cost assumptions; it is not an operational recommendation. The p in this calculation is risk without the action. Substituting the model's risk under an existing maintenance policy can be wrong.

Real decisions need inspection accuracy, repair cost, avoidable versus unavoidable downtime, competing work and parts availability. A technician finding no defect does not by itself establish a false prediction of the untreated outcome. Likewise, fewer failures after rollout do not prove the model prevented them without a suitable policy comparison.

8. Size both telemetry and the action queue

Suppose the alert policy generates 100 inspections per day and each requires 45 minutes of technician work:

daily inspection work = 100 × 45 / 60 = 75 hours
at 6 productive hours per technician: ceil(75 / 6) = 13 technicians

8 technicians provide 48 hours/day
inspection capacity = 48 × 60 / 45 = 64 alerts/day
queue growth = 100 − 64 = 36 alerts/day

This minimum ignores travel, variability and spare capacity. A warning with 48 hours of theoretical lead time may become useless while waiting in the queue. Track time from alert to inspection and action, not just model-to-failure lead time. Set priorities and alert thresholds with the available capacity, while preserving mandatory safety work.

For telemetry, assume 20 channels per pump, each sampled once per minute:

10,000 × 20 = 200,000 readings/minute
≈ 3,333.33 readings/second
at 16 raw bytes per timestamp/value pair:
10,000 × 20 × 1,440 × 16 = 4.608 GB/day

This payload estimate excludes asset identifiers, transport envelopes, storage indexes and replication. Five-minute scoring creates 10,000 × 288 = 2.88 million feature vectors per day, averaging 33.33 per second. Batch arrivals can produce a much higher instantaneous load.

A confirmed failure or competing removal may resolve an outcome earlier, but a negative seven-day outcome requires the full horizon plus reporting delay. Retraining on recent records whose outcomes are not yet known creates incorrect negatives. Monitor label backlog and intervention recording alongside model latency.

9. Roll out without corrupting the evidence

Start with shadow scoring to validate data quality, episode counts and lead time. Then introduce technician advisory use with logged decisions and reasons. Where operationally appropriate, compare maintenance policies under a controlled design that retains required inspections and safety procedures.

After deployment, the model changes which components are inspected and replaced. Log that intervention pathway. A drop in observed failures can make formerly useful predictors appear weak, while selectively inspected equipment produces more confirmed defects. Retraining must account for this feedback rather than interpreting every acted-on alert as an ordinary negative.

Monitor confirmed defects, unplanned downtime, inspection cost, queue aging, missed failures, data coverage and performance by site. Equipment changes, seasonal load and sensor recalibration can shift the input distribution. Recalibration needs fresh, appropriately matured evidence; it cannot repair a changed target definition by itself.

Failure analysis and self-review

  • Preventive replacement labeled as healthy survival: distinguish an observed competing event from the component's unobserved untreated future.
  • Replacement identity is wrong: risk may be assigned using the old bearing's age and sensor history.
  • Missing telemetry is treated as normal: loss of observation can coincide with the failure being predicted.
  • Every repeated alarm is a true positive: episode-level matching is needed to prevent inflated counts.
  • Good precision but no crew capacity: queue delay consumes actionable warning time.
  • Claimed prevented failures: prediction accuracy and causal maintenance benefit require different evidence.

Follow-ups: What changes for operating-hour horizons? How would you model electrical failure as a competing event? What if inspection findings are available only for alerted pumps? How would a site with no historical failures be evaluated?

A strong answer defines the policy-dependent target, treats censored and intervened records correctly and prevents asset/time leakage. It computes actionable coverage and maintenance capacity. An excellent answer separates observed risk from counterfactual benefit, handles intervention feedback and states what the available data cannot establish.

Sources and attribution

Retrieved September 27, 2026. The pump scenario, labeling examples, architecture and calculations are original. No company interview attribution or measured production benefit is claimed.

Continue your preparation

Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.