Choose the Block Threshold for a Pix Fraud Model

Last updated: November 29, 2026

Quick Overview

A model scores each outgoing Pix transfer for fraud risk; given estimated fraud loss per transfer, the cost of blocking a legitimate transfer, and a validation set of scores and labels, explain how you would choose the threshold for blocking versus asking for extra verification.

Nubank
Machine Learning
Data Scientist
Nubank
November 29, 2026
Data Scientist
Onsite
Machine Learning
Medium

0

0

0 solved


A model scores each outgoing Pix transfer for fraud risk; given estimated fraud loss per transfer, the cost of blocking a legitimate transfer, and a validation set of scores and labels, explain how you would choose the threshold for blocking versus asking for extra verification.

Pix fraud (account takeover, social engineering scams) is a top risk for Brazilian banks, and Nubank has to balance losses against the friction of blocking real customers. The interviewer wants cost-based thresholding rather than accuracy, awareness of class imbalance and label delay, and a sensible multi-action policy.

What the Interviewer Expects
  • Rejects accuracy and default 0.5 as the decision rule
  • Builds an expected cost function using amount-weighted fraud loss and friction cost
  • Uses calibrated probabilities or sweeps thresholds on validation data
  • Proposes three actions (allow, step-up, block) with two thresholds
  • Accounts for delayed and noisy fraud labels
  • Plans an online test with guardrail metrics
Key Topics to Cover
cost-sensitive classification
calibration
precision-recall
decision thresholds
label delay
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • Fraud labels arrive weeks later through chargebacks and customer complaints. How do you evaluate a model trained last week?
  • Fraudsters adapt to the threshold. How do you monitor and react?
  • How does the threshold change for a customer's first transfer to a new recipient at 2 a.m.?
  • Would you set one threshold for all customers or per segment?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

What actions exist (block, step-up with biometrics or a delay, allow)? Is the loss the full transfer amount (often yes for scams, since Pix is irreversible in practice)? What does a false block cost: ...

Approach

Treat it as minimizing expected cost per transfer. With calibrated score pp, amount aa, and friction cost cc for wrongly blocking, blocking is worth it when the expected avoided loss exceeds the ex...


Submit Your Answer
Markdown supported

Related Questions