Data Scientist Interview Question

You have a fraud dataset where 0.3 percent of rows are positive. How do you handle that imbalance?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

First change the metric, since accuracy is useless at 0.3 percent: use precision recall AUC, or recall at a fixed alert budget. Then try class weights before resampling, because weighting is simpler and does not fabricate rows. If you do resample, do it inside the training fold only. Finally recalibrate probabilities, since weighting and oversampling both distort the predicted scores.

Why interviewers ask this

Imbalance is where candidates reach for SMOTE reflexively without asking whether it helps. The interviewer wants to see the ordering: metric first, then simple weighting, then resampling only if needed, and always inside the fold. Mentioning calibration is a strong signal, because a resampled model that outputs 0.9 for something that happens one percent of the time breaks any downstream expected value calculation.

How to structure your answer

  • Fix the evaluation metric before touching the data.
  • Reach for class weights before synthetic oversampling.
  • Stress that any resampling happens inside the training fold only.
  • Mention recalibrating probabilities afterward.

Example answer

Spoken example, first person

The first thing I change is the scoreboard, because a model that predicts no fraud every time is 99.7 percent accurate and completely worthless. I use precision recall AUC and, more usefully, recall at whatever alert volume the team can actually review. Then I start simple with class weights in the loss, which costs nothing and often gets most of the benefit. I only reach for SMOTE or undersampling if weighting stalls, and honestly I have found synthetic minority samples underwhelming on tabular fraud data, because the interpolated points sit in regions of feature space that do not exist. Two things I am strict about. Resampling happens inside the training fold, never before the split, or the validation set ends up holding near duplicates of training rows and the score is fiction. And after any of this the predicted probabilities are no longer calibrated, so if anyone downstream multiplies the score by a dollar amount, I fit a calibration step on a clean holdout. On my last fraud model that shifted the expected loss estimate more than the model change did.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • Why does class weighting break probability calibration?
  • How would you calibrate, and on what data?
  • At what point would you decide the positive class is too rare to model at all?

Related data scientist questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot