Design fraud detection from raw transactions

Read the full interview experience this question came from →

Quick Overview

Design fraud detection from raw transactions evaluates ML product requirements, data/labeling, modeling, serving architecture, evaluation, monitoring, and trade-offs in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Design fraud detection from raw transactions

Company: PayPal

Role: Data Scientist

Category: ML System Design

Difficulty: hard

Interview Round: Onsite

You receive a large multi-table dataset of transactions and customer/merchant metadata with delayed or partial fraud labels. Design an end-to-end system to decide whether each transaction is fraudulent. Cover feature engineering (velocity, graph/link features, device/IP signals), handling class imbalance and label latency, training/validation splits that prevent leakage, thresholding for review capacity, real-time scoring and latency budgets, feedback loops from manual review/chargebacks, monitoring (drift, TPR/FPR, approval rate), and a backtesting plan.

Overview: Design fraud detection from raw transactions evaluates ML product requirements, data/labeling, modeling, serving architecture, evaluation, monitoring, and trade-offs in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Read the full PayPal Data Scientist interview experience this question came from

PayPal logo
PayPal
Jul 31, 2025
hardData ScientistOnsiteML System Design
10
0

Design fraud detection from raw transactions

System Design: End-to-End Transaction Fraud Detection

Context

You are given a large, multi-table dataset of transactions and customer/merchant metadata. Fraud labels arrive with delays (e.g., chargebacks weeks later) and may be partial (e.g., only for reviewed or disputed transactions). Design an end-to-end system to decide, in real time, whether to approve, decline, or send each transaction to manual review.

Requirements

Cover the following aspects with clear assumptions and rationale:

  1. Data and Feature Engineering
    • Velocity features (multi-horizon counts/sums/uniques).
    • Graph/link features across entities (user/card/email/device/IP/merchant).
    • Device and IP signals (fingerprinting, geolocation, proxy/TOR, ASN risk).
  2. Labels, Class Imbalance, and Latency
    • Handling severe class imbalance.
    • Handling delayed/partial labels and selective-label bias.
  3. Training and Validation Splits
    • Splitting to avoid leakage in time and across entities.
    • Ensuring offline/online feature parity.
  4. Decision Thresholding and Review Capacity
    • Approve/Decline/Review policy with cost-sensitive thresholds.
    • Meeting a fixed manual review capacity.
  5. Real-Time Scoring and Latency Budgets
    • Online feature retrieval and model serving under strict latency.
    • Fallbacks and degradation strategies.
  6. Feedback Loops
    • Incorporating manual review outcomes and chargebacks.
    • Exploration/holdout strategies to mitigate bias.
  7. Monitoring and Alerting
    • Drift (input/output), TPR/FPR with delayed labels, calibration, approval/decline rates, review queue health.
  8. Backtesting Plan
    • Time-ordered replay, off-policy evaluation, simulation of review capacity, metrics and confidence intervals.

State reasonable assumptions if needed and justify key design choices.

Clarifying Questions to Ask Guidance

  • Clarify users, core use cases, read/write patterns, scale, latency, availability, and data retention.
  • State explicit assumptions before making sizing or architecture decisions.
  • Prioritize the functional path first, then address reliability, security, observability, and rollout.

What a Strong Answer Covers Guidance

  • A scoped requirements summary with concrete non-goals and success metrics.
  • ML-specific data, model, evaluation, serving, and monitoring choices.
  • Reasoned trade-offs among simple and scalable designs, including bottlenecks and failure modes.
  • A validation, monitoring, migration, and launch plan appropriate for the risk level.

Follow-up Questions Guidance

  • What breaks first at 10x traffic or data volume?
  • How would you degrade gracefully during dependency failures?
  • What metrics and alerts would prove the design is healthy after launch?