Skip to content
elevatedevco

System Design

Design: Fraud Detection

Learn Design: Fraud Detection: 40 practice questions and answers with an interactive quiz — from the offline AI Learning app.

Professional40 questions9 quiz questions

Questions & Answers

Tap a question to reveal its answer. Written for self-study and interview preparation.

What is the most effective approach for handling severe class imbalance in a fraud detection training dataset?

Fraud events are extremely rare—typically 0.1% or less of all transactions. Handling imbalance: (1) Cost-sensitive learning—assign a higher misclassification cost to false negatives (missed fraud) in the loss function; weight = (1-fraud_rate)/fraud_rate for the positive class; (2) SMOTE or ADASYN—oversample minority class by synthesizing new fraud examples; use with caution as synthetic samples may not reflect real fraud patterns; (3) Undersampling majority class—randomly drop legitimate transactions; reduces training time but wastes data; (4) Threshold adjustment—train with balanced losses, then shift the decision threshold at inference to achieve the desired precision-recall operating point; (5) Anomaly detection framing—model fraud as an outlier detection problem using autoencoders or Isolation Forest, avoiding the imbalance problem entirely. Evaluate with PR-AUC (precision-recall area under curve) rather than ROC-AUC, which is insensitive to class imbalance.

Design a real-time credit card fraud detection system processing one million transactions per second.

Requirements: sub-100ms decision latency, high recall (catch >95% of fraud), low false positive rate (under 0.1% to avoid blocking legitimate customers). Pipeline: (1) Event ingestion—Kafka topic receives transaction events in real time with schema validation; (2) Feature engineering—pull user transaction history from a low-latency feature store (Redis): velocity features (transactions per hour, spend in last 24h), behavioral baselines (typical merchant category, amount distribution), device fingerprint, geolocation; (3) Real-time scoring—LightGBM or a two-layer neural network with sub-20ms inference; deployed on GPU cluster; (4) Rule engine overlay—hard block for known fraud patterns (blacklisted cards, impossible geolocation); (5) Post-decision feedback—chargebacks and dispute resolutions are streamed back as delayed labels for retraining; (6) Human review queue for high-confidence borderline cases. Metrics: recall at 1% FPR, dollar fraud loss prevented, false positive customer impact. Model retrained daily on new labeled data.

What velocity features are most predictive for transaction fraud detection?

Velocity features capture the rate and pattern of user activity over time windows: (1) Transaction count per hour, 6 hours, 24 hours, 7 days—sudden spikes indicate account compromise; (2) Total spend per time window—unusual large amounts or many small amounts (structuring); (3) Unique merchant count per hour—many different merchants in a short period suggests card testing; (4) Geographic velocity—distance between current transaction location and previous location divided by elapsed time; impossible velocities (200 km in 10 minutes) are strong fraud signals; (5) Declined transaction count per hour—repeated failed attempts before a successful transaction; (6) New merchant category flag—transaction in a category never seen in user history; (7) Card-not-present transaction count—online transactions spike during card compromise. Compute these features in a streaming pipeline using sliding-window aggregates stored in Redis with TTL-based expiration. Update windows with each new transaction event.

How do graph neural networks improve fraud detection at scale?

Fraud rings operate as networks: multiple compromised accounts sharing devices, IP addresses, or merchants. Traditional tabular models miss these network effects. GNN-based fraud detection: (1) Graph construction—build a heterogeneous graph with nodes for accounts, devices, IP addresses, merchants, and cards; edges represent shared attributes (same device used by two accounts, same IP for multiple accounts); (2) Message passing—GNN layers propagate suspicion scores through the graph: if one account is flagged, connected accounts become more suspicious; (3) Architecture—GraphSAGE or HGT (Heterogeneous Graph Transformer) for heterogeneous graphs; (4) Incremental updates—new transactions add edges to the graph; affected subgraphs are re-scored; (5) Scalability—partition the graph by merchant or geographic region; use Mini-batch GraphSAGE with neighborhood sampling for billion-node graphs. Pitfall: fraudsters split rings to reduce graph density; combine GNN scores with tabular features in an ensemble. Monitor for evolving ring patterns requiring graph schema updates.

What is the primary challenge with account takeover (ATO) fraud detection compared to transaction fraud?

Account takeover fraud involves a legitimate user's credentials being stolen and used by a fraudster. The primary challenge is that ATO happens at login, not at transaction time—the fraudster authenticates legitimately with stolen credentials, making the account appear valid to transaction fraud models. Detection signals differ from transaction fraud: (1) Login anomalies—unusual IP, device, location, or time of day; (2) Password reset activity immediately before transactions; (3) Profile change events (email or phone number changes) immediately after login; (4) New device fingerprint with no history on the account; (5) Browser fingerprint mismatches; (6) Typing cadence and mouse movement patterns (behavioral biometrics). Architecture: separate ATO detection model at login scoring login risk; triggered re-authentication (step-up challenge) for high-risk logins; session monitoring for suspicious post-login behavior. Pitfall: legitimate users travel and log in from new devices—need robust false positive management.

How do you design a hybrid rule-based and ML fraud detection system?

Production fraud detection combines rule-based systems (fast, interpretable, controllable) with ML models (adaptive, captures complex patterns). Architecture: (1) Rule engine—hard block rules for known fraud patterns: blacklisted IPs/cards/devices, impossible geolocation, transaction amount above absolute threshold; executes in under 1ms with no model inference; (2) ML scoring—LightGBM or neural network produces a fraud probability score in under 20ms for transactions passing rule filters; (3) Thresholded decision—auto-decline above a high threshold; auto-approve below a low threshold; send borderline cases to manual review; (4) Feedback loop—fraud analysts label manual review cases; new labels feed back into ML training; confirmed fraud patterns may be codified as new rules; (5) Model-in-the-loop rules—rules derived from model explanation (e.g., SHAP) capture the most consistently predictive features. Monitor: track rule hit rate, ML score distribution, and review queue volume. Alert on sudden changes in any signal.

How do you perform device fingerprinting for fraud detection?

Device fingerprinting collects browser and device attributes to create a unique identifier for each device, enabling tracking of fraud across sessions even without cookies. Attributes: User-Agent string, screen resolution, installed fonts, browser plugins, canvas fingerprint (rendered text pixel hash), WebGL renderer, time zone, language settings, and hardware concurrency. Combining these produces a high-entropy fingerprint that uniquely identifies most devices. Application in fraud detection: (1) New device on established account—trigger step-up authentication; (2) One device shared across many accounts—strong fraud signal (mule accounts or identity fraud ring); (3) Fingerprint inconsistency—claimed device attributes inconsistent with each other (headless browser, emulator, VPN mismatch); (4) Device reputation score—historical fraud rate associated with a device fingerprint ID. Pitfall: fingerprints are not perfectly stable (browser updates change them); use fuzzy matching with Jaccard similarity rather than exact matching. Privacy: device fingerprinting requires explicit consent disclosure under GDPR.

How do you handle the delayed feedback problem in fraud detection model training?

Fraud labels arrive long after the transaction: chargebacks arrive 30–120 days after the transaction, and disputes can take months to resolve. This creates several training challenges: (1) Stale model—if the model is retrained before labels arrive, recent transactions are unlabeled or incorrectly treated as legitimate; (2) Survivor bias—only transactions that weren't declined provide feedback, creating selection bias; (3) Label noise—some fraud is never reported (friendly fraud, small amounts). Solutions: (1) Waiting window—retrain only on transactions older than 90 days to ensure label completeness; (2) Partial label training—use confirmed fraud labels immediately as positive signal; treat recent unlabeled transactions as unknown rather than negative; (3) Delayed supervised learning—use a hazard model (survival analysis) that explicitly accounts for label censoring; (4) Online updates—incorporate early fraud signals (merchant disputes, user reports) as weak labels for faster model refresh. Monitor label arrival rate by transaction age to set appropriate training windows.

How should you select the decision threshold in a fraud detection system?

The decision threshold balances the cost of false negatives (missed fraud, financial loss) against false positives (blocked legitimate transactions, customer friction). Threshold selection is a business decision, not just a technical one. Steps: (1) Estimate cost of false negative—average fraud loss per transaction (e.g., $500); (2) Estimate cost of false positive—customer service cost, churn probability, and revenue loss per blocked legitimate transaction (e.g., $20 estimated value); (3) Select threshold minimizing total expected cost = FN_count × FN_cost + FP_count × FP_cost; (4) Operating point on PR curve—plot precision-recall at each threshold and select the point meeting business SLA (e.g., recall ≥ 95% at precision ≥ 90%); (5) Segment-specific thresholds—use different thresholds for high-value transactions (lower threshold = more conservative) versus low-value transactions. Revisit thresholds monthly as fraud patterns and transaction volumes change. Never set thresholds in isolation from fraud analyst and business stakeholders.

How do you detect and prevent synthetic identity fraud?

Synthetic identity fraud involves creating fictitious identities by combining real information (e.g., a real Social Security Number) with fabricated personal details to open accounts. These identities are built over months before committing bust-out fraud. Detection signals: (1) Identity consistency check—cross-reference name, date of birth, SSN, and address against authoritative databases; flag inconsistencies; (2) Credit history analysis—very thin credit files combined with sudden high-credit-limit applications; (3) Address velocity—same address used by many distinct identities recently; (4) Device and IP sharing—synthetic identities often managed from the same device or IP; (5) Behavioral patterns—synthetic accounts show unusual patterns: very regular payment behavior, then sudden maximum utilization and default. Graph analysis: cluster synthetic identities by shared attributes (same email domain prefix, similar name patterns, same device). ML: train on confirmed synthetic fraud cases with identity document features and behavioral sequences. Key challenge: no immediate label—fraud manifests months later.

How do you build a bot detection system for web and mobile applications?

Bots mimic human behavior to commit fraud (fake account creation, credential stuffing, promo abuse). Detection strategy: (1) Behavioral signals—mouse movement patterns, keystroke dynamics, scroll behavior, touch pressure; humans show natural variability while bots are suspiciously regular; (2) Interaction timing—sub-100ms form fill indicates automation; (3) JavaScript challenges—execute client-side JS that bots may not handle correctly; (4) CAPTCHA with ML scoring—serve CAPTCHA only for high-risk sessions; (5) Traffic pattern analysis—request rate, session length distribution, and user-agent diversity across IPs; bot farms show anomalous patterns; (6) Headless browser detection—check for WebDriver attributes, missing browser APIs, inconsistent rendering; (7) IP reputation—rate of fraud associated with each IP range; flag datacenter and VPN IPs. ML: train a session-level binary classifier on all behavioral features. Challenge: sophisticated bots (CAPTCHA-solving services, human-bot hybrids) are increasingly hard to detect and require continuous model updates.

How do you explain fraud model decisions to affected customers and internal analysts?

Explainability in fraud detection serves two audiences: customers who want to understand why their transaction was declined, and fraud analysts who need to investigate cases. Methods: (1) SHAP (SHapley Additive exPlanations)—compute per-feature contribution scores for each decision; output the top 3 features driving the fraud score (e.g., 'unusual transaction location: +0.4, new device: +0.3'); (2) LIME—local linear approximation around the prediction point; (3) Rule extraction—convert high-confidence model regions into human-readable rules for analyst review; (4) Counterfactual explanations—'your transaction would have been approved if the amount were below $200.' Customer-facing explanations must be generic enough not to reveal fraud detection logic (to prevent gaming) while still being actionable. Analyst-facing explanations should include full feature values and their contributions. Regulatory context: GDPR and US FCRA require meaningful explanation for automated adverse decisions.

How do you detect and prevent promotional abuse (promo fraud) at scale?

Promotional fraud involves users exploiting referral bonuses, coupon codes, or welcome offers with fake or multiple accounts. Detection: (1) Identity clustering—cluster accounts by shared device fingerprint, IP, payment method, email domain, and address; accounts sharing multiple attributes are likely operated by the same person; (2) Velocity detection—multiple accounts from the same IP or device claiming a promotion within a short window; (3) Behavior patterns—promo abusers often claim the bonus and immediately withdraw with minimal other activity; (4) Network analysis—visualize shared-attribute graphs; dense clusters of 'new' accounts indicate abuse rings; (5) Email analysis—disposable email domains (mailnull, guerrillamail) used for account creation. Prevention: (1) Limit promotions by verified payment method rather than email; (2) Require phone number verification with carrier-grade check; (3) Delay promotion payout until after first genuine transaction. ML: train a binary classifier on account-level features with confirmed abuse labels from fraud analyst reviews.

How do you monitor and detect model drift in a production fraud detection system?

Fraud patterns evolve continuously as fraudsters adapt to detection systems. Drift monitoring: (1) Score distribution monitoring—track the distribution of model output fraud scores daily; sudden shifts in the P95 or mean score indicate input distribution change; (2) Feature drift—use PSI (Population Stability Index) on each input feature (transaction amount, time-of-day distribution, merchant category mix); PSI above 0.2 triggers retraining; (3) Performance monitoring—track precision, recall, and dollar loss on confirmed fraud labels (delayed by 90 days); declining recall indicates the model misses new fraud patterns; (4) Rule hit rate—monitor how often hard-coded rules fire; a sudden spike or drop in a specific rule indicates pattern change; (5) Fraud analyst feedback—analysts reviewing cases flag when model explanations don't match observed fraud patterns. Retraining triggers: metric degradation, feature drift, new fraud type emergence, or scheduled cadence (weekly). Shadow-deploy new models and compare metrics before promotion.

How do you build a new account fraud detection system?

New account fraud involves opening accounts with stolen or synthetic identities to commit immediate fraud. Challenge: no transaction history exists; must decide at account creation time. Signals: (1) Identity verification—cross-check provided PII (name, DOB, SSN, address) against credit bureau and identity databases; flag inconsistencies; (2) Document verification—for higher-risk accounts, require government ID scan + selfie liveness check; (3) Email and phone validation—disposable email providers, VoIP phone numbers, and recently registered domains are high-risk signals; (4) Device and network—datacenter IP, residential proxy, or previously flagged device; (5) Application pattern—form fill speed, field edit patterns, session duration during application; (6) Information consistency—cross-field consistency checks (zip code matches state, age matches DOB format). ML: gradient boosting classifier on identity and device features. Tiered response: low-risk users pass freely; medium-risk get additional verification steps; high-risk applications are declined or queued for manual review.

How do you use feature stores in a real-time fraud detection pipeline?

Feature stores centralize feature computation and serving, ensuring consistency between training and inference. Architecture: (1) Offline feature store—historical aggregated features (user 90-day spend average, merchant fraud rate) computed via daily Spark jobs and stored in BigQuery or Hive; used for training dataset generation; (2) Online feature store—real-time features (transactions in last 1 hour, time since last login) computed via Flink streaming and stored in Redis or DynamoDB for sub-5ms lookup; (3) Point-in-time correctness—during training, only features available at prediction time are included; implemented via time-range joins in the offline store; (4) Feature freshness—online features must be updated within 1 second of a new transaction to capture velocity correctly; (5) Unified API—a single feature serving endpoint aggregates from both online and offline stores, allowing the scoring model to request all features in one call. Pitfall: training-serving skew (different feature computation in training vs production) is a major source of model degradation in fraud systems.

What is the primary purpose of using a two-model approach (pre-screening plus full scoring) in fraud detection?

A two-model approach separates a very fast, cheap pre-screening model from a more expensive, accurate full scoring model. Pre-screening model (sub-1ms, runs on CPU): simple rule-based or linear model that quickly eliminates clearly legitimate transactions (very low fraud probability) from further processing. This avoids running the expensive model on the vast majority of legitimate transactions. Full scoring model (10–50ms, GPU-accelerated): a deep learning or gradient-boosted model with hundreds of features run only on transactions that pass pre-screening. Benefits: dramatically reduces compute cost and latency for the 99%+ of transactions that are clearly legitimate; concentrates expensive inference resources on ambiguous cases. The pre-screening threshold is set very conservatively (high recall, accept some false positives passing to stage 2) to ensure virtually no actual fraud bypasses stage 1. This is similar to the two-stage retrieval-ranking pattern in recommendation systems.

How do you detect money laundering patterns using machine learning?

Anti-money laundering (AML) detection identifies patterns suggesting illicit funds are being moved through legitimate financial channels. Challenges: low volume of labeled cases, long investigation timelines, complex multi-step schemes. Approaches: (1) Transaction monitoring rules—hard-coded rules flag structuring (breaking large amounts into sub-reporting-threshold transactions), round-number transactions, and high-frequency transfers to new accounts; (2) Graph-based analysis—build a transaction graph (nodes = accounts, edges = transfers); detect cycles (layering: A→B→C→A), fan-in/fan-out patterns (smurfing), and shell company chains using graph analytics (PageRank, community detection); (3) ML anomaly detection—autoencoder trained on normal transaction patterns; high reconstruction error flags suspicious activity; (4) Entity risk scoring—combine transaction velocity, geographic dispersion, counterparty risk, and account age into a risk score. Regulatory context: ML predictions in AML typically feed into Suspicious Activity Reports (SARs) reviewed by human investigators rather than automated decisions.

How do you implement behavioral biometrics for continuous authentication to prevent account takeover?

Behavioral biometrics continuously verify user identity during a session based on how they interact with a device: (1) Keystroke dynamics—inter-key timing, hold duration, rhythm patterns unique to each user; (2) Mouse movement patterns—velocity, curvature, acceleration, resting position; (3) Touch patterns (mobile)—pressure, swipe speed, finger size, scrolling rhythm; (4) Typing cadence—words per minute, error rate, correction patterns. Implementation: collect behavioral signals from JavaScript SDK or mobile SDK in the background; extract statistical features per session; compare against stored user behavioral profile using distance metrics (Mahalanobis, cosine) or a binary classifier (this session matches the registered user). High-risk divergence triggers step-up authentication (OTP, biometric). Benefits: invisible to the user when authentication succeeds; catches ATO even after initial login. Pitfall: profiles must adapt over time (users change their behavior); use online learning to update profiles. Strict consent and data minimization required under GDPR.

What is the difference between supervised and unsupervised approaches in fraud detection?

Supervised fraud detection trains on labeled historical fraud cases (fraud = 1, legitimate = 0), learning explicit patterns associated with confirmed fraud. Strengths: high precision when labeled data is abundant; naturally supports threshold tuning. Weaknesses: requires labeled data which is expensive to obtain and delayed; cannot detect entirely novel fraud types not present in training data; biased toward known fraud patterns. Unsupervised fraud detection learns what 'normal' looks like without labels and flags statistical anomalies: Isolation Forest, Autoencoder, DBSCAN, or one-class SVM. Strengths: can detect unknown fraud patterns; no labeled data required; useful during the cold start of a new product. Weaknesses: high false positive rate; anomalies may not be fraud; tuning requires domain expertise. Best practice: use unsupervised methods to surface suspicious cases for analyst review, then feed analyst labels back into a supervised model. A semi-supervised approach combining both achieves the best of both worlds.

How do you evaluate a fraud detection model beyond AUC-ROC?

AUC-ROC is insufficient for fraud detection because it is insensitive to class imbalance and does not reflect real operating conditions. Better evaluation approaches: (1) PR-AUC (precision-recall area under curve)—measures performance in the imbalanced regime; directly reflects the recall-precision tradeoff at the operating threshold; (2) KS statistic—maximum separation between the cumulative fraud and legitimate score distributions; useful for ranking quality; (3) Detection rate at fixed FPR—recall at 1% or 0.1% false positive rate matches production SLAs; (4) Dollar amount caught—weight fraud cases by transaction amount to measure financial impact; (5) Top-K lift—among the top-K highest-scored transactions, what fraction is actually fraud? Measures model ranking quality for review queues; (6) Cost-based metric—total expected cost using actual fraud loss and false positive customer impact estimates. Always evaluate on a time-based holdout (train on past, evaluate on future) to prevent temporal leakage.

How do you design a fraud detection system for a buy-now-pay-later (BNPL) product?

BNPL fraud has unique characteristics: fraudsters use stolen identities to make purchases they never intend to repay. Assessment occurs at checkout (instant decision required). Challenges: (1) No prior credit relationship—many BNPL users are credit-invisible; cannot rely on traditional credit bureau scores; (2) High velocity—fraudsters attempt BNPL fraud rapidly across merchants before detection; (3) Merchant-specific risk—some product categories (electronics, gift cards) have much higher fraud rates. Signals: (1) Alternative credit signals—bank account linking, income verification, rent payment history; (2) Device and behavioral signals at checkout—device fingerprint, browser behavior, form fill speed; (3) Cart analysis—product type, amount relative to typical order for this merchant; (4) Identity verification—real-time KYC check; (5) Application-to-purchase velocity—time from account creation to first purchase (very fast = suspicious). Model: gradient boosting or neural network; decision in under 500ms. Feedback: BNPL delinquencies provide ground truth after 30–90 days. Calibrate risk models per merchant vertical.

What is federated fraud detection and when is it appropriate?

Federated fraud detection allows multiple financial institutions to train a shared fraud model without sharing raw customer data, which is critical for regulatory compliance and competitive sensitivity. Architecture: (1) Each bank trains a local model on its own transaction data; (2) Local model gradients or model updates are encrypted and sent to a central aggregator; (3) The aggregator applies secure aggregation (homomorphic encryption or secure multi-party computation) and updates the global model; (4) The improved global model is distributed back to participants. Benefits: shared model benefits from all participating banks' fraud patterns, including rare fraud types that a single bank may not see; enables cross-institution fraud ring detection. Appropriate when: individual institutions have insufficient data for certain fraud types, regulatory prohibitions prevent data sharing, or competitive concerns prevent data pooling. Pitfalls: slower convergence, higher infrastructure complexity, potential gradient inversion attacks. Combine with differential privacy (DP-SGD) to bound individual transaction leakage.

How do you build a chargeback prediction model to prioritize fraud investigator workload?

Not all disputed transactions are fraudulent—some are friendly fraud (customer denies a legitimate purchase). Chargeback prediction prioritizes the investigation queue for fraud analysts. Design: (1) Features—transaction amount, merchant category, time since transaction, customer chargeback history, days since account opening, device fingerprint match at transaction time, geographic anomaly score; (2) Model—gradient boosting (LightGBM) trained on historical chargeback labels (confirmed fraud vs friendly fraud vs legitimate dispute resolved in merchant favor); (3) Multi-class output—predict probability of each outcome: confirmed fraud, friendly fraud, legitimate dispute; (4) Priority scoring—rank the review queue by the expected financial impact weighted by fraud probability; (5) Threshold tuning—analysts review top-K highest-risk cases each day; tune K to match analyst capacity while maximizing dollar recovery. Feedback loop: analyst decisions are fed back as labeled training data monthly. Monitor: recovery rate, analyst accuracy, and queue backlog as operational metrics.

What is the key challenge of using graph-based signals in real-time fraud detection?

Graph-based fraud signals (shared devices, IP clusters, transaction network) are powerful but challenging to compute in real time. The primary challenge is that graph computations are inherently batch-oriented—maintaining a live, queryable fraud graph at massive transaction volume requires significant engineering. Specific challenges: (1) Graph update latency—adding a new transaction edge and propagating suspicion scores to affected nodes takes milliseconds to seconds; (2) Subgraph queries—checking if a new account shares attributes with a known fraud cluster requires fast graph traversal, which is hard at billion-node scale; (3) Stale graph—if graph updates lag behind transaction volume, real-time decisions use outdated network risk scores; (4) Infrastructure complexity—graph databases (Neo4j, Amazon Neptune, TigerGraph) are complex to operate at scale. Solutions: pre-compute and cache node risk scores that update asynchronously (near-real-time); query cached node scores synchronously at decision time (sub-5ms). Full real-time GNN inference is reserved for high-value transaction reviews.

How do you handle adversarial adaptation by sophisticated fraudsters?

Sophisticated fraudsters study fraud detection systems and adapt their behavior to evade detection. Adversarial robustness strategies: (1) Diversity in detection—use an ensemble of diverse models (rule-based, gradient boosting, neural network, graph-based); evading one does not evade all; (2) Model secrecy—never publicly disclose score thresholds, features, or decision logic; partial disclosure for regulatory compliance only; (3) Adversarial training—augment training data with synthetically generated adversarial examples (transactions designed to evade the current model); (4) Continuous retraining—retrain weekly on the most recent confirmed fraud labels to capture evolving evasion strategies; (5) Honeypot accounts—maintain synthetic accounts known to be fraud-only; transactions involving honeypot accounts are confirmed fraud instantly, providing fast ground truth; (6) Behavioral consistency—fraudsters who carefully control transaction amounts often have unnaturally regular patterns detectable as anomalies. Accept that the fraud-detection relationship is an ongoing arms race requiring continuous investment.

How do you design the feedback loop from fraud analyst decisions back into the ML model?

Fraud analysts review borderline cases and confirm or clear suspected fraud; these decisions are the most reliable labels available. Feedback loop design: (1) Label capture—analyst decisions are recorded with timestamps, transaction IDs, fraud category, and reasoning; (2) Label aggregation—multiple analyst decisions on the same transaction are resolved via majority vote or consensus workflow; (3) Training pipeline integration—confirmed fraud cases are added to the training dataset daily; confirmed legitimate cases are added as high-quality negative samples; (4) Analyst disagreement handling—cases with high analyst disagreement are flagged for senior review before being used as training labels; (5) Feedback latency—target under 48 hours from review to training data inclusion for fast response to emerging fraud patterns; (6) Active learning—surface the most informative unlabeled cases (highest model uncertainty or highest expected information gain) to analysts to maximize the value of analyst time. Monitor analyst accuracy by tracking false positive and false negative rates on cases analysts flagged, using delayed chargeback data as ground truth.

What is 'friendly fraud' and how do you distinguish it from genuine fraud?

Friendly fraud (also called first-party fraud or chargeback fraud) occurs when a legitimate cardholder disputes a valid transaction to get a refund while keeping the product or service. It is distinct from genuine third-party fraud where a stolen card is used without the cardholder's knowledge. Distinguishing signals: (1) Transaction authentication—was 3D Secure or biometric authentication used? Authenticated transactions are harder to dispute successfully; (2) Delivery confirmation—was the product delivered and signed for at the registered address? (3) Dispute pattern history—has this customer filed multiple chargebacks in the past? Multiple disputes strongly suggest friendly fraud; (4) Device match—was the purchase device the same as the customer's registered device? (5) Post-dispute behavior—did the customer continue using the account after the dispute (suggests they weren't actually compromised)? ML model: train a multi-class classifier distinguishing third-party fraud, friendly fraud, and legitimate disputes using these signals. Regulatory note: merchants can contest chargebacks with evidence; the ML model output supports evidence preparation.

How do you handle geographical anomaly detection in fraud?

Geographic anomaly detection flags transactions from locations inconsistent with a user's established patterns. Implementation: (1) User location profile—maintain a rolling distribution of transaction locations (country, city) for each user, weighted by recency; (2) Impossible travel detection—if transaction A occurs in New York at 2pm and transaction B occurs in London at 4pm, flag as impossible (4,000 miles in 2 hours); compute via Haversine distance and elapsed time; (3) IP geolocation vs billing address—flag when IP resolves to a different country than the registered billing address, especially for high-value transactions; (4) VPN and proxy detection—IP addresses resolving to known VPN providers, Tor exit nodes, or datacenter IP ranges are flagged as high-risk; (5) Location velocity—new location not in user history for 12-month period. ML integration: geographic anomaly score (distance from user's centroid, normalized by speed of light travel constraint) is a feature in the overall fraud model. Privacy: IP geolocation data should be processed with appropriate retention limits.

How do you design an ML system to prevent payment fraud in a peer-to-peer transfer application?

P2P transfer fraud differs from credit card fraud: fraudsters often socially engineer legitimate users into sending money voluntarily (authorized push payment fraud). Characteristics: the account owner initiates the transfer, making reversal extremely difficult. Detection approaches: (1) Social engineering indicators—sudden first transfer to a new payee following an unusual incoming call or message; (2) Recipient risk scoring—new accounts with no history, accounts that receive then immediately forward funds, accounts linked to known fraud rings; (3) Behavioral deviation—transfer amount, time of day, and payee type inconsistent with user's historical P2P behavior; (4) Friction injection—for high-risk transfers, introduce a cooling-off period (e.g., 24-hour hold on first transfer to a new payee above $500) with a confirmation step; (5) Real-time warning—show user a warning message if the recipient account is flagged. Challenge: the victim authorizes the transfer, so standard fraud block is inappropriate; friction and education are the primary defenses. Monitor authorized push payment (APP) fraud rate separately from unauthorized fraud rate.

How do you use semi-supervised learning to improve fraud detection when labeled data is scarce?

Labeled fraud examples are expensive to obtain (analyst time, delayed labels) while unlabeled transaction data is abundant. Semi-supervised learning leverages both. Approaches: (1) Self-training—train an initial model on labeled data; use it to pseudo-label high-confidence unlabeled examples; retrain on the combined dataset; iterate; (2) Label propagation—on a transaction similarity graph, propagate labels from known fraud to similar unlabeled transactions; (3) Co-training—train two models on different feature subsets; each model labels high-confidence examples for the other to learn from; (4) Contrastive learning—pre-train an encoder on unlabeled transactions using contrastive loss (similar transactions should have similar embeddings); fine-tune on labeled fraud examples; (5) Data augmentation—generate additional synthetic fraud examples via SMOTE or GAN-based synthesis from the limited labeled set. Best practice: start with a simple supervised model on labeled data; add semi-supervised components when the labeled data yields below-target performance. Always validate semi-supervised approaches against a held-out labeled test set.

How should you design the model update strategy for a fraud detection system to minimize exposure during model transitions?

Model transitions in fraud detection are high-stakes: a poorly performing new model can cause significant financial loss within hours before rollback. Safe update strategy: (1) Shadow deployment—run the new model in parallel with the production model, logging its decisions without acting on them; compare metrics for 1–2 weeks; (2) Canary release—route 1% of traffic to the new model, monitor precision and recall on this slice, and gradually increase traffic to 5%, 20%, 100%; (3) Champion-challenger framework—production model (champion) is compared to the new model (challenger) on matched traffic; champion is replaced only when challenger shows statistically significant improvement; (4) Automatic rollback—trigger automated rollback if online precision drops more than 2% or recall drops more than 3% compared to the previous week; (5) Time-based validation—validate on the most recent week of transactions to catch seasonality effects. Coordinate model transitions with fraud analyst teams so they can increase review capacity during the transition window.

How do you scale a fraud detection system to handle global transaction volumes with regional compliance requirements?

Global fraud detection must balance centralized model quality with regional regulatory compliance (GDPR in Europe, PIPL in China, state privacy laws in the US). Architecture: (1) Regional data residency—store transaction data within its originating region; compute features locally; send only aggregated, anonymized signals to a global model coordinator; (2) Regional model instances—deploy region-specific model instances fine-tuned on local fraud patterns and compliant with local feature restrictions; (3) Global fraud intelligence—share anonymized fraud pattern signatures (not raw data) across regions via a federated aggregator; (4) Latency optimization—co-locate model serving infrastructure with regional transaction processors to minimize cross-region latency; (5) Currency and merchant normalization—normalize transaction amounts to a common currency and map merchant categories to a global taxonomy before feature extraction. Compliance: data protection officers in each region review which cross-regional signals can be used. Pitfall: regional model silos may miss global fraud rings that operate across borders; federated pattern sharing is critical.

How do you detect collusion fraud between merchants and customers?

Merchant-customer collusion fraud involves a merchant colluding with customers to process fraudulent refunds or chargebacks to the card network, splitting the proceeds. Detection signals: (1) Refund-to-sales ratio—merchant's refund rate significantly above industry baseline; (2) Chargeback concentration—unusually high chargeback rate from a specific merchant compared to peers in the same category; (3) Round-number refunds—suspiciously consistent refund amounts without corresponding purchase amounts; (4) Refund timing patterns—refunds processed at unusual hours or in rapid succession; (5) Customer-merchant overlap graph—if a cluster of customers with high chargeback histories all transact exclusively with the same merchant; (6) Transaction void patterns—high void rate immediately after authorization at specific merchants. ML: train a merchant-level risk model on aggregated transaction patterns; flag high-risk merchants for investigation. Escalation: confirmed collusion cases are referred to the card network (Visa, Mastercard) for merchant termination. Monitor: track merchant termination actions as ground truth labels for model improvement.

Which technique is most effective for reducing false positives in a fraud detection system without significantly reducing recall?

Reducing false positives while maintaining recall requires moving the operating point on the precision-recall curve without shifting the curve itself. The most effective technique is a second-stage verification model: (1) First-stage model flags suspected fraud at high recall (catches 99% of fraud, accepts 5% FPR); (2) Second-stage model re-scores only the flagged transactions using additional features (device behavioral biometrics, extended transaction context, user history depth), with a higher precision target. This two-stage approach raises precision of the final decision set while preserving the high-recall property of stage one. Other effective techniques: personalized thresholds (lower threshold for high-risk user cohorts, higher for established users with clean history), and confidence calibration (use well-calibrated probability outputs and set thresholds per segment). Feature addition—adding high-precision features like device behavioral signals—also shifts the PR curve favorably.

How do you approach model fairness in fraud detection across protected demographic groups?

Fraud detection models can exhibit disparate impact: higher false positive rates for certain demographic groups (e.g., minority customers more often incorrectly declined) due to biased training data or proxy features. Assessment: (1) Audit false positive and false negative rates stratified by race, gender, age, and geography; (2) Identify proxy features—zip code, name origin, and income proxies can encode demographic information; (3) Disparate impact testing—use the 80% rule (any group's approval rate should be at least 80% of the highest-approved group's rate). Mitigation: (1) Remove or transform proxy features that encode demographics without adding fraud signal; (2) Fairness-aware training—add demographic parity or equal opportunity constraints to the loss function; (3) Threshold calibration—set group-specific decision thresholds to equalize false positive rates across groups; (4) Representation in training data—ensure labeled fraud data is representative across demographic segments. Regulatory context: Equal Credit Opportunity Act (ECOA) and Fair Housing Act require non-discriminatory credit decisions in the US.

How do you design an alert triage system to help fraud analysts prioritize their review queue?

Fraud analysts reviewing a queue of flagged transactions must prioritize effectively to maximize dollar amount caught within their capacity. Triage system design: (1) Priority scoring formula—priority = fraud_probability × transaction_amount × urgency_factor; urgency_factor accounts for reversal window (credit card disputes have a time limit); (2) Case clustering—group related alerts (same device, same fraud ring, same merchant) so analysts can review them together, sharing context and reducing redundant investigation steps; (3) Auto-resolution—route very high-confidence fraud cases (above 0.98 probability) directly to decline without analyst review; route very low-confidence cases (below 0.1) to auto-approve; (4) Queue time limits—alert on cases exceeding 4-hour review SLA; escalate to senior analysts; (5) Analyst routing—match case type (ATO, transaction fraud, merchant fraud) to analyst specialization. Dashboard: real-time queue depth, coverage rate (% of fraud caught), analyst throughput, and false positive rate on reviewed cases. Target: review all alerts above $500 within 2 hours.

What are the key considerations for deploying a fraud detection model in a streaming versus batch architecture?

Fraud detection requires real-time decisions at authorization time—batch scoring is insufficient for transactions where a decline must be issued within 200ms. Key considerations: (1) Streaming architecture—Kafka + Flink pipeline consuming transaction events; features computed in streaming (velocity windows, real-time behavioral signals); model inference via a synchronous gRPC call to a model server; result returned before authorization timeout; (2) Batch architecture—used for risk scoring of accounts or merchants periodically (daily risk assessment, AML monitoring); not suitable for authorization decisions; (3) Hybrid—batch features (30-day spend average, account risk score) pre-computed and cached; streaming features (last-hour velocity, current session behavior) computed in real time; both joined at inference time; (4) Latency budget—total decision latency must stay under 200ms; allocate budget across feature fetching (20ms), model inference (20ms), and overhead; (5) Consistency—ensure streaming feature computations are idempotent and exactly-once to prevent double-counting transaction events. Monitor streaming pipeline lag as a critical health metric.

What does 'training-serving skew' mean in fraud detection and how do you prevent it?

Training-serving skew occurs when the features used during model training differ from those available at inference time in production. In fraud detection, this is particularly harmful because even small feature discrepancies can cause significant recall drops on real fraud. Common sources: (1) Feature computation differences—velocity windows computed differently in offline ETL (Spark) versus online streaming (Flink), resulting in different values for the same transaction; (2) Timestamp handling—using future data accidentally during training (label leakage) when features are not computed with point-in-time correctness; (3) Missing values—training treats NaN as a specific value; production receives a different representation; (4) Data transformations—normalization or encoding applied in the training pipeline but not reproduced exactly in the serving pipeline. Prevention: (1) Use a unified feature store with a single feature computation definition; (2) Log raw feature values at serving time and compare them to training-time values for the same transactions; (3) Run regular skew checks: compute feature distributions from the serving log and compare to training data distributions using PSI.

How do you implement real-time feedback from fraud outcomes to update streaming feature aggregates?

Streaming feature aggregates (velocity counts, spend sums) must reflect the latest confirmed fraud labels to remain accurate. Real-time feedback loop: (1) Fraud outcome events—when a transaction is confirmed as fraud (by analyst or chargeback), publish a fraud outcome event to a dedicated Kafka topic; (2) Streaming consumer—Flink job consuming the fraud outcome topic; for each confirmed fraud event, it updates user-level aggregates: fraud count per hour, fraud amount per day, account risk score; (3) Derived features—once a card or account is confirmed fraudulent, all future transactions from the same account inherit a high-risk flag immediately; (4) Retroactive updates—when an analyst confirms fraud on a transaction from 2 hours ago, retroactively mark that session's device and IP as high-risk in the feature store; (5) Eventual consistency—accept that feature updates arrive with some latency (seconds to minutes); design the fraud model to be robust to slightly stale features. Test the feedback pipeline end-to-end by injecting synthetic confirmed fraud events and verifying that derived features update within the SLA.

Put it into practice with AI Learning

This topic — and hundreds more — comes from our free, offline AI Learning app. Practice Q&A, quizzes and cheat sheets anywhere, no account needed.

  • Free
  • No account
  • Works offline
Coming soon toGoogle Play