Pharmacy Supply Chain Risk Analytics
Asked of: Data Scientist
Last updated
What's being tested
Interviewers probe your ability to turn pharmacy operations data into actionable risk signals: forecasting demand and lead-time, defining and validating stockout/risk metrics, diagnosing anomalies, and separating correlation from causation. At CVS Health this maps directly to patient continuity and regulatory/financial risk, so expect emphasis on model robustness, rare-event handling, and explainability for stakeholders.
Core knowledge
-
Stockout / fill rate definitions: fill rate = shipped units / ordered units; measure at SKU-store-day and aggregated by week, supplier, and RDC (regional distribution center) for operational actionability.
-
Lead time demand & safety stock formula: safety stock = z * σ_{demand_LT}, where σ_{demand_LT} = sqrt(Lσ_D^2 + D̄^2σ_L^2); use z from desired service level (e.g., 95%).
-
Intermittent demand handling: Croston’s method or intermittent-aware loss (MASE or RMSSE); avoid naive MAPE for zero-heavy series—use MASE or sMAPE instead.
-
Time-series CV: use rolling-origin (walk-forward) cross-validation with embargoed windows to avoid leakage across promotions or seasonality; evaluate multiple horizons (1,7,30 days).
-
Forecast models & tradeoffs: statistical (ETS/
ARIMA) good for interpretability;Prophetfor holiday effects; tree models (XGBoost,LightGBM) for cross-sectional features and cold-start. For N up to ~100k SKUs, ensemble + reconciliation scales; millions require hierarchical or demand-compression. -
Hierarchical forecasting & reconciliation: forecast at SKU-store and SKU-region levels, reconcile with MinT or bottom-up/top-down to preserve aggregate accuracy and avoid inventory inconsistencies.
-
Rare-event classification: predicting stockout events needs class-imbalance tactics (resampling, focal loss, class weights) and metrics like PR-AUC, precision@K, and recall for top-risk stores—optimize for operational cost of false negatives.
-
Causal vs predictive: use causal inference tools (DiD, synthetic control, ITS) when evaluating supplier changes or policy; predictive models can flag risk but not prove impact of interventions.
-
Anomaly detection & monitoring: use statistical control charts (CUSUM, EWMA) on lead time, fill rate, and outbound volume; pair automated detection with supplier-level drilldowns and changepoint analysis.
-
Feature engineering signals: lagged demand, promo flags, inventory on hand, days-of-supply, supplier reliability (late shipments rate), PO lead time distribution, and external signals (flu season indices, ICD-coded claims).
-
Evaluation tied to business cost: translate model outcomes to dollar or patient-impact metrics (stockout-days avoided, lost-dispensations, emergency substitutions); use cost-sensitive thresholds for deployment.
Worked example — Predict pharmacy stockouts 7 days ahead
Clarify scope: ask whether prediction is per SKU-store, per store (all-SKU), and whether the label is "any stockout" or "X% fill rate below threshold"; confirm available features and labeling delay. Frame answer around three pillars: (1) target definition and exploratory analysis to understand intermittency and seasonality, (2) modeling approach (time-series models for high-volume SKUs, gradient-boosted trees for cross-sectional cold-start), and (3) evaluation and deployment (rolling-origin CV, PR-AUC and recall at fixed operational budgets, and weekly alerting). For features, emphasize lead-time-aware variables (days-of-supply, incoming POs) and calendar effects (holidays, known health events). Flag the key tradeoff: optimize for recall (avoid missed stockouts) at the expense of more false positives that operational teams can triage, or optimize precision if triage capacity is limited. Close by saying: if more time, I’d run an ablation to quantify feature importance, build a simple causal check for supplier-level confounding, and run a pilot with human-in-the-loop threshold tuning.
A second angle — Causal impact of supplier consolidation on fill rates
If asked to evaluate whether consolidating suppliers caused a drop in fill rate, pivot from prediction to causal design: define pre/post windows, identify comparable control pharmacies (matching on baseline fill rate, volume, geography), and run a difference-in-differences or synthetic control. Emphasize checks: parallel trends test, placebo periods, and sensitivity to spillovers (a supplier outage may affect multiple stores). Data limitations (non-random consolidation assignments) drive choice of method; if randomization isn’t possible, rely on rich covariates and robustness checks rather than claiming definitive causality.
Common pitfalls
Pitfall: Treating forecasting like a generic ML problem.
Building a single global model without accounting for intermittent demand, hierarchical structure, and SKU heterogeneity often yields misleading average metrics and misses tail risks.
Pitfall: Using mean-based error metrics for zero-inflated series.
Reporting MAPE or RMSE on intermittent SKU series understates practical failure modes; evaluate with MASE, service-level attainment, and event-based recall/precision.
Pitfall: Overstating causality from correlated signals.
Claiming a supplier caused stockouts because of concurrent demand spikes or seasonality will harm credibility; always present robustness checks, alternative explanations, and confidence intervals.
Connections
Interviewers may pivot to inventory optimization and ask about reorder policies (s,Q,R) or to ML-engineering topics like feature-store design and real-time scoring for alerts. They may also move into prescriptive analytics (optimization to minimize stockouts given budget).
Further reading
-
Forecasting: principles and practice (Hyndman & Athanasopoulos) — practical time-series methods, intermittent demand, and cross-validation guidance.
-
Brodersen et al., “Inferring causal impact using Bayesian structural time-series models” (CausalImpact) — good primer for evaluation of interventions in time series.