MLCrack

    ML SYSTEM DESIGN & MLOPS Β· INTERVIEW QUESTION

    What is data drift and concept drift? How do you detect and handle them?

    🟑 intermediate · Monitoring & Observability

    Hint: Input distribution changes vs relationship between input and output changes.

    Answer

    Data drift: input feature distribution P(X)P(X) changes over time (e.g., user demographics shift). Concept drift: the relationship P(Y∣X)P(Y|X) between features and target changes (e.g., user preferences evolve).

    Types: sudden (overnight change), gradual (slow shift), recurring (seasonal), incremental (continuous).

    Detection:

    1. Statistical tests: KS test, PSI (Population Stability Index), chi-squared for categorical features.

    2. Model performance monitoring: track accuracy, latency over time.

    3. Prediction distribution monitoring: shifts in output scores. Handling:

    4. Retrain on recent data (sliding window)

    Online learning (incremental updates) 3. Ensemble with concept drift detectors 4. Feature monitoring alerts.

    Best practice: monitor both input features AND model performance. Performance drop without data drift suggests concept drift.