Skip to content
Interview prep / ML/Data

25 machine learning and data quant interview questions with answers

25 original quant ML and data questions with answers on point-in-time joins, leakage, validation, calibration, regularisation and production monitoring.

How to approach these questions

A financial model can fail before fitting begins if its features use revised data or its joins create records that never existed at the decision time. These examples move from data contracts and time-aware evaluation to model choice and production diagnostics. This is an expanded original public guide; it is not limited to the smaller ML section currently present in our dashboard bank.

Audit time and granularity

Define when each value became available, what one row represents and whether join keys are unique. A correct-looking table can still contain future information or duplicated outcomes.

Evaluate the deployment task

Use evaluation periods, label gaps, costs and metrics that match the intended decision. A high score is useful only in relation to a baseline and an operational objective.

Keep the whole pipeline reproducible

Record preprocessing, feature rules, data versions and monitoring responses alongside model parameters. Changes upstream can invalidate a model even when its saved weights stay fixed.

Sample questions, answers and explanations

Try each question before reading its answer. These original teaching examples remain free to read on this page.

Data availability and preparation

Start with information timing and join contracts; model quality cannot repair leaked or duplicated observations.

1. Prediction timestamp

What must be defined before constructing features for a trading model?

Answer: The exact decision timestamp and which information is available then.

Explanation: A feature can be statistically predictive but unavailable when the trade must be placed. Availability is part of the feature definition.

2. Point-in-time join

How should a model join a historical decision to a company report?

Answer: Use the most recent report actually published by the decision time, accounting for revisions.

Explanation: Joining by reporting-period end can use information published later. Point-in-time availability prevents that look-ahead error.

3. Row multiplication in joins

Why might joining two tables by date unexpectedly increase row count?

Answer: The key may be nonunique on both sides, creating a many-to-many join.

Explanation: Check key uniqueness and intended granularity before joining. A larger dataset can reflect duplicated combinations rather than new observations.

4. Missing values

Should missing values always be replaced with zero?

Answer: No; first identify what missingness means and choose an appropriate treatment.

Explanation: Zero may be a meaningful economic value. A missing indicator, model-based imputation or exclusion has different assumptions and consequences.

5. Fit preprocessing

When should a standard scaler's mean and variance be estimated?

Answer: On training data only, then applied unchanged to validation and test data.

Explanation: Fitting preprocessing on all data leaks information about the evaluation distribution. Put learned transformations inside the training pipeline.

Evaluation and baseline design

Reserve unseen data, handle overlapping labels and compare alternatives on the same task.

6. Time-series splits

What evaluation split matches a model that will predict tomorrow from historical data?

Answer: Train on earlier periods and evaluate on later periods, often in rolling or expanding windows.

Explanation: The split should imitate deployment. Consider label overlap and changes in market conditions when choosing gaps and windows.

7. Overlapping labels

Daily examples predict the next 10 days of returns. Why might a simple adjacent train/test split leak information?

Answer: Labels near the boundary share future return observations with the test period.

Explanation: Remove or gap overlapping training labels around the boundary. A chronological feature split alone does not remove label overlap.

8. Reusing the test set

What happens if you repeatedly tune a model after checking its test-set score?

Answer: The test set becomes part of model selection and loses its role as an untouched evaluation.

Explanation: Repeated choices adapt to test noise. Keep a separate final holdout or use a justified nested evaluation design.

9. Establish a baseline

Why compare a complex forecast model with a simple baseline?

Answer: To measure whether the added complexity improves the task enough to justify its cost.

Explanation: Use the same information, evaluation periods and cost assumptions. A weak or mismatched baseline makes improvements uninformative.

10. Imbalanced classification

Only 1% of labels are positive. Is 99% accuracy enough to demonstrate a useful classifier?

Answer: No; always predicting negative achieves 99%.

Explanation: Examine precision, recall, calibration and decision cost. Select metrics that reflect what the model is used to do.

Metrics and regularisation

Choose measures and penalties that reflect the target decision rather than a convenient headline score.

11. Precision versus recall

A detector flags 20 cases, 8 truly positive; there are 10 positives overall. Find precision and recall.

Answer: Precision 40%; recall 80%.

Explanation: Precision divides true positives by flagged cases; recall divides by all actual positives. The denominators answer different questions.

12. Calibrated probabilities

What does it mean for a binary forecast to be calibrated?

Answer: Among cases assigned probability p, the event occurs about a fraction p of the time.

Explanation: Calibration concerns probability reliability, not just ranking. A model can rank well while giving overconfident probabilities.

13. Decision threshold

Should every calibrated binary model use a classification threshold of 0.5?

Answer: No; the threshold should reflect the relative costs and benefits of decisions.

Explanation: With false-positive cost C_FP and false-negative cost C_FN, the simple loss-minimising threshold is C_FP/(C_FP + C_FN).

14. Regularisation

What does an L2 penalty encourage in a linear model?

Answer: Smaller coefficients through a penalty proportional to their squared magnitude.

Explanation: It trades training fit for controlled complexity. Feature scaling matters because the penalty acts on coefficient size.

15. L1 versus L2

Why can an L1 penalty produce exactly zero coefficients?

Answer: Its absolute-value penalty has a corner at zero.

Explanation: The optimum can sit at that corner, inducing sparsity. L2 generally shrinks without producing exact zeros in ordinary unconstrained fits.

Models and distribution shift

Understand what each method optimises and what could change when new observations arrive.

16. Tree overfitting

Why can a very deep decision tree overfit?

Answer: It can isolate small training subsets and fit noise with highly specific rules.

Explanation: Restrict depth or leaf size and validate out of sample. Perfect training accuracy is not evidence of generalisation.

17. Bagging

What problem does bagging primarily try to reduce?

Answer: Prediction variance by averaging models fit to perturbed training samples.

Explanation: Gains depend on base-model instability and diversity. Highly correlated model errors limit the benefit of averaging.

18. PCA objective

What does the first principal component maximise?

Answer: Variance of the projected centred data among unit-length directions.

Explanation: PCA is unsupervised: a high-variance direction need not be most predictive of a target. Scaling changes the objective.

19. Distribution shift

What should you monitor when a model moves from research into production?

Answer: Input and label distributions, missingness, calibration, performance and execution outcomes.

Explanation: Stable code does not imply stable data. Tie alerts to a response plan and distinguish unavailable labels from poor performance.

20. Survivorship bias

Why is testing a historical stock strategy on today's index members misleading?

Answer: It excludes firms that left the index, including failed or deteriorating firms.

Explanation: The historical investment universe must reflect what was selectable then. A current constituent list uses future survival information.

Historical realism and production

Revisions, costs and pipeline changes connect research results to actual decisions.

21. Revised data

Why can today's downloaded macroeconomic history exaggerate a historical model's performance?

Answer: Historical values may include revisions unavailable at the original decision time.

Explanation: Use vintage releases or explicitly model publication and revision timing. Chronological splitting cannot repair a revised input history.

22. Predictive score versus trading value

Does a higher prediction score guarantee a more profitable trading strategy?

Answer: No.

Explanation: Turnover, transaction costs, capacity and position sizing affect economic value. Evaluate the decision rule as well as the forecast.

23. Feature importance

Does a high model feature-importance score prove that the feature causes the target?

Answer: No.

Explanation: Importance is conditional on the model, data and metric. Correlated features and leakage can distort it; causality requires additional identification.

24. Reproduce a pipeline

What must accompany a saved model to reproduce its predictions?

Answer: The feature definitions, preprocessing, versions, input schema, availability rules and model parameters.

Explanation: A model file is only one stage. Unrecorded transformations or data revisions can change outputs without changing its weights.

25. Investigate errors

How would you investigate a model with good average performance but large occasional losses?

Answer: Slice errors by regime, exposure, data quality and decision size, then inspect tail cases.

Explanation: An aggregate metric can hide economically important failure modes. Keep analysis separate from post-hoc tuning on the final holdout.

105 ml/data questions from the bank

Each question has its own page with a short answer and a credit to its source. Hints and full worked solutions are in the question bank with a free account.

  1. Closed-form maximum likelihood weights for linear regressionHard
  2. Reverse regression slope from the forward slopeEasy
  3. SQL for the pair of traders with nearest median P&LEasy
  4. SQL to find the most active META trader this monthEasy
  5. SQL for each trader's top-earning strategy last weekEasy
  6. OLS with duplicate signalsMedium
  7. Ridge normal equationsMedium
  8. Correlated factors under ridge and lassoMedium
  9. Feature scaling changes the penaltyEasy
  10. A penalty on the interceptEasy
  11. OLS does not require Gaussian featuresEasy
  12. Heteroscedastic return residualsMedium
  13. Omitted correlated informationMedium
  14. More features than observationsMedium
  15. Bayesian interpretation of ridgeMedium
  16. Logistic probabilities and a linear scoreEasy
  17. Complete separation in logistic regressionHard
  18. MSE versus MAE for noisy targetsMedium
  19. Huber loss for contaminated observationsMedium
  20. Bias and variance under regularisationEasy
  21. PCA truncation before regressionMedium
  22. A falling out-of-sample R squaredMedium
  23. Interactions in a linear modelEasy
  24. Shrinkage chosen using tomorrow's dataEasy
  25. Residual diagnostics and a trendMedium
  26. Weighted loss for different assetsMedium
  27. Quantile loss and downside estimatesMedium
  28. Prediction intervals versus coefficient intervalsEasy
  29. Transforming a positive targetMedium
  30. Learning curves for weak signalsMedium
  31. Overlapping five-day labelsHard
  32. Scaling the full historyEasy
  33. Random row splits in an asset panelMedium
  34. Nested chronological model selectionHard
  35. Expanding or rolling training windowsMedium
  36. Features with publication delaysMedium
  37. Revised fundamentals in a backtestMedium
  38. Target encoding inside foldsMedium
  39. Feature screening before validationMedium
  40. Tuning after repeated holdout checksMedium
  41. Bootstrap with serial dependenceHard
  42. Two models on the same datesMedium
  43. Hundreds of attempted signalsHard
  44. Survivorship in the training universeMedium
  45. Retraining while labels matureMedium
  46. Leakage through interpolationMedium
  47. Daily cross-sectional normalisationMedium
  48. Cross-validation for unseen issuersMedium
  49. Purging and embargo are differentHard
  50. Averaging errors across foldsMedium

What our question-bank data shows

Our bank summary dated contains 284 ML/Data entries in the bank. Counts describe entries in our curated practice bank, including its source and classification choices. They do not measure employer interview frequency, candidate success rates or how often any one question is asked.

  • Regression and Regularisation: 25 entries, or 8.8% of this topic's bank. Use this coverage to identify areas for practice alongside the technique-based examples above.
  • Validation and Leakage: 25 entries, or 8.8% of this topic's bank. Use this coverage to identify areas for practice alongside the technique-based examples above.
  • Classification: 19 entries, or 6.7% of this topic's bank. Use this coverage to identify areas for practice alongside the technique-based examples above.

The public examples above were written for these guides. They illustrate the techniques and are not a reproduction or ranking of the bank's sourced questions. The dashboard's broader bank combines sourced questions, worked answers where available and references for book entries without a reproduced solution.

Subtopic coverage in the bank

SubtopicBank entries
Regression and Regularisation25
Validation and Leakage25
Classification19
Data Wrangling16
Regularization15
Trees and Feature Engineering15
ML Implementation15
Quant Research Cases15
Text classification14
Linear regression13
Neural networks for computer vision13
Optimization in neural networks12
Ranking and search11
Random forest9
Neural networks9
Gradient boosting8
Clustering7
Time series7
Validation6
Decision trees6
Recommender systems6
Feature selection5
Neural Networks and Optimisation5
Dimensionality reduction3
Machine Learning2
Parameter tuning2
Supervised machine learning1

Bank difficulty labels: 66 easy · 191 medium · 27 hard.

Lessons behind the techniques

Use these lesson previews to find the definitions and derivations behind the worked examples.

Continue with 284 ml/data questions in the practice bank.

Open the ml/data bank

Other interview topic guides