MLCrack

    ML SYSTEM DESIGN & MLOPS ยท INTERVIEW QUESTION

    Design a fraud detection system. What ML and engineering challenges arise?

    ๐Ÿ”ด advanced ยท System Design Patterns

    Hint: Think about extreme class imbalance, real-time requirements, adversarial behavior.

    Answer

    Architecture:

    1. Feature engineering: transaction features (amount, time, frequency), user features (account age, history), network features (graph of transactions). Real-time aggregation from streaming (Kafka/Flink).
    2. Model: gradient boosted trees (XGBoost) for interpretability + neural network for complex patterns. Ensemble for robustness.
    3. Serving: real-time scoring <100ms. Feature store for consistent features.
    4. Challenges: extreme imbalance (0.1% fraud) โ€” use focal loss, undersampling, anomaly detection. Adversarial adaptation โ€” fraudsters evolve, need frequent retraining. Concept drift โ€” patterns change.
    5. Human-in-the-loop: flag uncertain cases for review.
    6. Evaluation: precision-recall at business-relevant thresholds, $$$ value of caught fraud.
    7. Feedback loop: investigation outcomes label new training data. Alert fatigue: too many false positives burn analyst time.