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:
- Feature engineering: transaction features (amount, time, frequency), user features (account age, history), network features (graph of transactions). Real-time aggregation from streaming (Kafka/Flink).
- Model: gradient boosted trees (XGBoost) for interpretability + neural network for complex patterns. Ensemble for robustness.
- Serving: real-time scoring <100ms. Feature store for consistent features.
- Challenges: extreme imbalance (0.1% fraud) โ use focal loss, undersampling, anomaly detection. Adversarial adaptation โ fraudsters evolve, need frequent retraining. Concept drift โ patterns change.
- Human-in-the-loop: flag uncertain cases for review.
- Evaluation: precision-recall at business-relevant thresholds, $$$ value of caught fraud.
- Feedback loop: investigation outcomes label new training data. Alert fatigue: too many false positives burn analyst time.
Related questions
- Design a real-time ML serving system for a recommendation engine handling 10k QPS.
- What are ML design patterns? Explain the Feature Store pattern.
- When should you train/fine-tune your own LLM vs use a 3rd-party API?
- What is LLMOps and how does it differ from traditional MLOps?
- What is data drift and concept drift? How do you detect and handle them?