
Real Interview Questions for the Data Scientist at Prosus
NewInterview Q&A
Q&A-1Explain the difference between supervised and unsupervised learning?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
The difference is whether the training data carries a target to predict. In supervised learning each example comes with a label, so the model learns a mapping from features to that label and you can measure error directly. In unsupervised learning there is no label, so the model looks for structure in the features themselves, such as groups, low dimensional representations or anomalies, and you judge it by whether that structure is stable and useful downstream.
At Prosus that distinction decides the project shape. Predicting whether a PayU account will churn in the next 90 days, or whether a transaction is fraud, is supervised because the outcome is recorded in history. Segmenting OLX or Avito users into behaviour groups, or embedding product listings so similar items sit close together, is unsupervised because no one has labelled the groups in advance.
| Supervised | Unsupervised | |
|---|---|---|
| Training signal | Feature vector plus known label y | Feature vector only |
| Typical tasks | Classification, regression, ranking | Clustering, dimensionality reduction, anomaly detection, density estimation |
| Output | A prediction for a new case, with a score or class | A group id, a projection, or an anomaly score |
| How you evaluate | Held out labelled set: accuracy, AUC, RMSE, precision and recall | No ground truth: cluster stability, silhouette, reconstruction error, downstream lift |
| Main cost | Getting labels that are timely, correct and representative | Deciding what the discovered structure means |
| Prosus example | Fraud classifier trained on confirmed fraud cases | K-means segments of shoppers for personalised offers |
# Python 3.11, scikit-learn 1.5. Checked against the 1.5 API.
from sklearn.ensemble import HistGradientBoostingClassifier
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
# Supervised: X_train has columns such as amount, tenure, device_count.
# y_train is 1 for confirmed fraud, 0 otherwise.
clf = HistGradientBoostingClassifier(max_iter=200, learning_rate=0.06)
clf.fit(X_train, y_train)
fraud_score = clf.predict_proba(X_new)[:, 1]
# Unsupervised: same feature matrix, no y. Standardise first in practice.
km = KMeans(n_clusters=6, n_init=10, random_state=42).fit(X_train)
segment = km.labels_
reduced = PCA(n_components=10).fit_transform(X_train)Why evaluation differs, with numbers
Supervised evaluation is arithmetic on a confusion matrix. Suppose on a held out set of 1,000 transactions the fraud model gives TP = 80, FP = 20, FN = 40, TN = 860. Precision is 80 / (80 + 20) = 0.80, recall is 80 / (80 + 40) = 0.67, and F1 is 0.73. Those numbers only mean something if the held out labels were collected the same way as the training labels and after the prediction time. A common failure is leakage: a feature such as case_closed_date or a post-transaction dispute flag is present in training but would not exist when the model scores a live transaction. The offline AUC looks excellent and production performance collapses.
Unsupervised evaluation has no equivalent table. A K-means run with k = 6 will always return six groups, even on noise. I check stability by refitting on a bootstrap sample or a later month and measuring how many points keep the same cluster, and I check utility by whether the segment changes a decision, for example whether offer take up differs by segment in a randomised test. If neither holds, the clusters are a description of the algorithm, not of the users.
Failure modes I would name in the loop
Supervised models fail on label definition and drift. Fraud labels are often confirmed weeks later, so recent positives are missing and the training set undercounts the target class. Churn labels depend on the observation window: a user who returns on day 91 is labelled churned for a 90 day target even though the behaviour is borderline. Both problems show up as a gap between offline metrics and live outcomes, and the fix is usually a stricter label pipeline and a time based split, not a larger model.
Unsupervised models fail on scaling and interpretation. K-means on raw features will be dominated by whichever column has the largest variance, often transaction amount, so standardisation and a check on correlated features come before any clustering. PCA components are also easy to over read: a component that loads on amount and frequency is not a discovered customer type, it is a weighted average. I would report loadings and stability alongside any segment definition.
Between the two sit semi supervised and self supervised approaches, where a small labelled set is combined with a large unlabelled set, or where the label is derived from the data itself, such as predicting a masked field. I would mention them only if the interviewer asks about scarce labels, because for a first answer the clean split is labels present versus labels absent, and the practical consequence is how you prove the model works.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-2What are some common metrics to evaluate the performance of a regression model?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
For regression I would start with MAE and RMSE, then add a scale-free metric and a bias check, because no single number tells you both how large the errors are and whether they are systematic. At Prosus, say I am predicting order value or GMV for a marketplace, where a few very large orders sit in a long tail. MAE tells me the typical error in currency units, RMSE tells me how much large misses dominate, and mean signed error tells me if I am consistently over or under predicting. I would report all three on a held-out test set, split by segment, before I trusted any of them.
What each metric actually measures
| Metric | Formula | What it rewards | Where it misleads |
|---|---|---|---|
| MAE | mean |y - yhat| | Typical error, in target units | Treats a 10x miss the same as ten 1x misses |
| RMSE | sqrt(mean (y - yhat)^2) | Penalises large errors heavily | One outlier can decide the ranking |
| RMSLE / log RMSE | RMSE on log1p(y) | Relative error, good for skewed positive targets | Hides absolute cost, undefined for negative targets |
| MAPE | mean |y - yhat| / y | Percentage error | Explodes near y = 0, undefined at y = 0 |
| R2 | 1 - SS_res / SS_tot | Improvement over predicting the mean | Negative out of sample, not comparable across segments with different variance |
| Median AE, p90 AE | quantiles of |y - yhat| | Shows the tail a mean hides | No single optimisation target |
MAE and RMSE have the same units as the target, so a product team can translate them. If MAE on order value is 18 BRL, that is the average absolute miss per order. R2 has no units. An R2 of 0.85 on high-value electronics and 0.40 on low-value groceries does not mean the first model is better in money terms. It means variance differs.
Worked trace, hypothetical figures
Actual order values: 100, 200, 300, 1000. Predictions: 110, 190, 330, 700. Define signed error as yhat - y, so a positive value is overprediction.
| y | yhat | error (yhat - y) | |error| | error^2 |
|---|---|---|---|---|
| 100 | 110 | 10 | 10 | 100 |
| 200 | 190 | -10 | 10 | 100 |
| 300 | 330 | 30 | 30 | 900 |
| 1000 | 700 | -300 | 300 | 90000 |
MAE = (10 + 10 + 30 + 300) / 4 = 87.5. RMSE = sqrt(91100 / 4) = 150.9. Mean signed error = (10 - 10 + 30 - 300) / 4 = -67.5, so the model underpredicts on average, driven by the large order. MAPE = (10% + 5% + 10% + 30%) / 4 = 13.75%. Note how RMSE is almost double MAE here. That gap is the signal that one large miss dominates. If I only reported R2, I would miss that.
In Python, checked against scikit-learn 1.5:
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
import numpy as np
y = np.array([100, 200, 300, 1000])
yhat = np.array([110, 190, 330, 700])
mae = mean_absolute_error(y, yhat) # 87.5
rmse = np.sqrt(mean_squared_error(y, yhat)) # 150.9
bias = np.mean(yhat - y) # -67.5, negative means underprediction on average
print(mae, rmse, bias, r2_score(y, yhat))Choosing for a skewed business target
Order value, seller payout and loan amount are usually right-skewed and strictly positive. Training on log1p(y) and reporting RMSLE often matches the business cost better, because a 20% miss on a 1000 BRL order matters more than a 20% miss on a 20 BRL order, and log errors treat those equally. The catch is back-transformation bias. Exponentiating a log prediction estimates the median, not the mean, so expected GMV will be understated unless I apply a correction or calibrate on the original scale.
I would also check calibration by decile of predicted value. Plot mean actual against mean predicted per decile. A model can have a good overall RMSE and still overpredict small orders and underpredict large ones, which is exactly the pattern in the trace above. That pattern matters if the prediction feeds pricing, credit limits or inventory, because the error is not random noise, it is a systematic distortion in the segment where money concentrates.
Failure modes I would name in the interview
Leakage inflates every metric. If a feature is recorded after the order, test R2 looks excellent and production collapses. I check feature timestamps against prediction time. Distribution shift does the same thing more slowly. A model evaluated on last quarter's mix of categories will mislead when the mix changes, so I evaluate on a recent time-based split, not a random split, and I re-score by category, region and seller tier.
Finally, I would tie the metric to the decision. If the cost of underpredicting a high-value order is higher than overpredicting, MAE and RMSE both hide that asymmetry. Then I would use quantile regression or a weighted loss and report p90 error and mean signed error per segment alongside the headline metric. That is the answer I would defend: MAE for typical error, RMSE for tail sensitivity, a relative metric for skewed targets, R2 only as context, and bias and segment breakdowns to catch systematic misses.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-3How would you handle missing data in a dataset?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would not impute anything until I know why the values are missing, because the right treatment depends on the mechanism and on whether this is training data or a live scoring pipeline. I would start with three checks: how much is missing per column and per row, whether missingness correlates with the target or with other observed features, and whether the pattern changed over time or by segment.
That gives me MCAR, MAR or MNAR, and each one changes the decision.
| Mechanism | Meaning | Example in a lending dataset | Default treatment |
|---|---|---|---|
| MCAR | Missingness unrelated to anything observed or unobserved | A sensor outage drops a field at random | Complete-case analysis is unbiased, imputation is safe |
| MAR | Missingness depends on observed data | Younger applicants skip income fields more often, and age is recorded | Impute conditional on observed features, or use a model that handles missing values natively |
| MNAR | Missingness depends on the missing value itself | Applicants with very low income leave income blank | Dropping or mean imputation biases the sample, add a missingness indicator and investigate the source |
Worked trace: what I would actually check
Suppose I get 100,000 loan applications, target is default within 12 months, and income is missing in 18% of rows.
| Check | Result in this hypothetical example | What it tells me |
|---|---|---|
| Missing rate by target | 11% for non-defaults, 31% for defaults | Missingness predicts the target, so it is not MCAR |
| Missing rate by age band | 26% under 30, 9% over 50 | Part of the pattern is explained by observed age, consistent with MAR |
| Missing rate by channel | 4% on web, 22% on mobile | A collection artefact, fixable upstream, and a train-serve risk if channel mix shifts |
| Missing rate over time | 8% in Jan, 19% in Jun | Something changed in the form or the data pipeline, I would not pool blindly |
If I dropped those rows I would remove a disproportionate share of defaults and understate risk. If I mean-imputed income I would pull low-income defaults toward the average and flatten the signal. The indicator income_missing itself carries information here, so I keep it as a feature and flag the collection issue to the product team.
How I would implement it
For tabular models I would usually compare three options on a time-based validation split, not a random split, because missingness patterns drift:
- A model with native missing-value handling, such as LightGBM or XGBoost, which learns a default direction for missing values at each split.
- Median imputation plus a missingness indicator, fitted on the training fold only.
- Model-based imputation, for example iterative imputation or a conditional median by segment, when the feature is important and MAR is plausible.
import numpy as np
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn.pipeline import Pipeline
from sklearn.ensemble import HistGradientBoostingClassifier
# Fit inside the pipeline so imputation statistics come from train only.
# add_indicator keeps the missingness signal instead of erasing it.
pipe = Pipeline([
("imputer", SimpleImputer(strategy="median", add_indicator=True)),
("model", HistGradientBoostingClassifier(max_iter=300, learning_rate=0.06)),
])
pipe.fit(X_train, y_train)
proba = pipe.predict_proba(X_valid)[:, 1]The pipeline matters. Fitting the median on the full dataset before splitting leaks information from validation into training and inflates offline metrics. In production the same fitted pipeline must be serialised with the model, otherwise training and serving diverge when the median shifts.
Failure modes I would watch for
Leakage through imputation is the common one. A second is silent train-serve skew: a field that was 4% missing in training becomes 40% missing after a form change, and a model that relied on it degrades without any error being raised. I would monitor missing rates per feature in production and alert on a shift of more than a few percentage points week on week.
A third failure mode is treating MNAR as MAR. If high-value customers refuse a survey question precisely because of their spending, conditional imputation will systematically overstate their spend. In that case I would prefer the indicator plus native missing handling, and I would say plainly in the model documentation that estimates for that segment are biased.
For a quick baseline, dropping rows is acceptable only when missingness is low, roughly under 5%, and plausibly MCAR. Above that, or whenever missingness correlates with the target, I keep the rows, keep the indicator, and let validation decide between native handling and imputation.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-4Describe a machine learning algorithm you have implemented and the challenges you faced?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I implemented a gradient-boosted tree model for short-term credit risk at a fintech lender, predicting 30-day default from loan, repayment and bureau features. I chose LightGBM over logistic regression because the relationship between utilisation, missed payments and default is non-linear and interacts with loan size, and over a neural network because we had 1.2 million rows, mostly tabular, and needed feature-level explanations for credit review.
The model reached AUC 0.81 on a time-based holdout versus 0.76 for our logistic baseline. The hard parts were not the boosting itself. They were leakage from features computed after disbursement, severe class imbalance at 4.1% defaults, and probability calibration, because the business sets interest and limits from the predicted probability, not just the rank order.
What I built
# Python 3.11, LightGBM 4.3, scikit-learn 1.5
import lightgbm as lgb
from sklearn.calibration import CalibratedClassifierCV
from sklearn.metrics import roc_auc_score, brier_score_loss
# Train on loans disbursed Jan-Aug, validate Sep-Oct, test Nov-Dec.
# Features are snapshotted at disbursement time only.
model = lgb.LGBMClassifier(
n_estimators=600, learning_rate=0.04, num_leaves=31,
min_child_samples=80, subsample=0.8, colsample_bytree=0.8,
scale_pos_weight=6, random_state=42,
)
model.fit(X_train, y_train, eval_set=[(X_valid, y_valid)],
callbacks=[lgb.early_stopping(50, verbose=False)])
calibrated = CalibratedClassifierCV(model, method="isotonic", cv="prefit")
calibrated.fit(X_valid, y_valid)
p = calibrated.predict_proba(X_test)[:, 1]
print(roc_auc_score(y_test, p), brier_score_loss(y_test, p))scale_pos_weight=6 was a starting point, not the answer. It improved recall at a fixed threshold but badly distorted probabilities, which is why calibration on a separate validation period mattered more than the weight.
Challenge 1: leakage that looked like performance
My first run hit AUC 0.94. One feature, days_since_last_payment, had been computed at export time rather than at disbursement, so for defaulted loans it encoded the default itself. The fix was a point-in-time join: every feature value had to be the latest value with event_time <= disbursement_time, and I added an automated check that rejected any feature whose timestamp distribution post-dated the prediction point. After the fix AUC fell to 0.81. That drop was the honest number, and it is the one I reported.
Challenge 2: imbalance and the wrong metric
With 4.1% positives, accuracy was 96% for a model that predicted nobody defaults. I reported AUC for ranking, precision and recall at the operating threshold the business actually used, and Brier score for calibration. At a threshold chosen to flag the riskiest 10% of applicants, recall was 38% and precision 17%. That meant roughly 1 in 6 flagged loans defaulted, against 1 in 24 overall. Stating it that way let the risk team trade off review capacity against losses, instead of arguing about AUC in isolation.
Challenge 3: calibration drift after launch
Three months after launch, predicted default rates in the 8 to 12% band were running about 3 points low. Macro conditions had shifted and the mix of new versus repeat borrowers had changed. I monitored calibration monthly by decile, plus population stability index on the top features, with PSI above 0.2 triggering a review. The response was not a full retrain on day one. We recalibrated on the most recent 60 days of matured outcomes, kept the tree structure, and only retrained when ranking also degraded, which it did at month five.
| Decision | Alternative | Why I did not use it here |
|---|---|---|
| LightGBM | Logistic regression | Missed interactions, AUC 0.76, but kept as a challenger and fallback |
| LightGBM | Neural network | No gain on tabular data of this size, harder to explain to credit reviewers |
| Isotonic calibration | Platt scaling | Isotonic fit the non-linear miscalibration better on validation, at the cost of needing more calibration data |
| Time-based split | Random split | Random split leaks future repayment behaviour into training and overstates AUC by about 0.05 in our tests |
What I would do differently
I would build the point-in-time feature pipeline before any modelling, and I would log the exact feature snapshot with each score so a declined applicant can be reconstructed later. I also under-invested early in monitoring. The model was fine; the world moved. For a Prosus-scale portfolio, where the same model may score across countries with different bureau coverage, I would validate calibration per market rather than pooling, because a pooled model can be well calibrated on average and badly wrong in the smallest segment.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-5What techniques do you use for feature selection?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I start by asking what the features are for. If I am building a model that will score in production, I optimise for out of sample performance, stability over time, and serving cost. If the model supports a decision that a regulator or a customer can challenge, I also optimise for a short, defensible feature list. Those two goals pull in different directions, so I state which one I am serving before I pick a technique.
In practice I use four families, and I usually combine them. Filter methods rank features without training the final model. Wrapper methods search subsets by scoring the model itself. Embedded methods let a regularised model or a tree ensemble do the selection while it fits. Domain and stability checks sit on top of all three, because a feature that wins on one random split and disappears on the next is a liability in production.
| Family | What it does | When I reach for it | Main weakness |
|---|---|---|---|
| Filter: mutual information, ANOVA F, correlation | Scores each feature against the target, or against other features | Fast first pass over hundreds of features, cheap to rerun | Univariate scores miss interactions and keep redundant correlated copies |
| Wrapper: forward selection, recursive feature elimination | Adds or drops features and scores the actual estimator | Small feature sets, or when the estimator is cheap | Expensive, and it overfits the validation split it searches on |
| Embedded: L1 logistic regression, tree importance, SHAP | Selection happens inside fitting | Default for tabular models, handles correlated groups better than a single filter | Tree importance favours high cardinality features, L1 picks one of a correlated pair arbitrarily |
| Domain and stability | Keeps features with a plausible mechanism, checks selection frequency across bootstrap samples and time windows | Credit, payments and marketplace models where drift and audit matter | Slower, needs a feature store or at least a feature dictionary with definitions |
How I run it on a real dataset
Take a credit risk example I have worked on: 42,000 loan applications, 180 candidate features from application data, bureau data and transaction aggregates, binary target for default within 12 months. I split by time, not randomly, because random splits leak future behaviour into training. All selection happens inside the training window only.
# Python 3.11, scikit-learn 1.5
from sklearn.feature_selection import SelectKBest, mutual_info_classif
from sklearn.linear_model import LogisticRegressionCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
pipe = Pipeline([
("scale", StandardScaler()),
("select", SelectKBest(mutual_info_classif, k=40)),
("model", LogisticRegressionCV(Cs=[0.01, 0.1, 1.0], penalty="l1",
solver="saga", max_iter=2000, cv=3)),
])
pipe.fit(X_train, y_train) # X_train is the earlier time window onlyThat pipeline is a starting point, not the answer. I then run stability selection: 50 bootstrap resamples of the training window, refit the L1 model each time, and record how often each feature survives with a non zero coefficient. Features selected in more than 80 percent of resamples form my candidate set. In the example above that reduced 180 features to 31, and a time based holdout showed AUC 0.81 with 31 features against 0.815 with all 180. The small drop bought a model I could explain to risk, and a scoring payload that fits in a real time API.
| Feature (hypothetical example) | Selection frequency over 50 bootstraps | Decision |
|---|---|---|
| bureau_score_12m | 50 / 50 | Keep |
| income_to_loan_ratio | 47 / 50 | Keep |
| tx_count_30d | 44 / 50 | Keep |
| device_id_hash | 41 / 50 | Drop, identifier with no mechanism and high cardinality |
| marketing_campaign_code | 18 / 50 | Drop, unstable across windows |
| application_channel | 12 / 50 | Drop, proxy for a protected attribute in this portfolio |
Failure modes I check for
Leakage is the first. A feature computed after the decision point, such as collections activity in the first month after disbursement, will look excellent in training and fail on day one in production. I check the feature timestamp against the prediction timestamp for every candidate, and I compute aggregates with a strict cutoff.
The second is selection bias. If I run SelectKBest on the full dataset and then cross validate the model, the validation scores are inflated because the validation rows already influenced which features survived. The fix is to put selection inside the pipeline, as above, or inside each fold of a nested cross validation, and to report the outer score.
The third is correlated redundancy. Mutual information will rank five versions of the same transaction aggregate in the top ten. I cluster features with absolute correlation above 0.9 and keep one representative per cluster, chosen by stability and by cost to compute at serving time. A feature that needs a nightly batch job to compute is a different proposition from one available in the transaction stream.
I validate the final set three ways. Permutation importance on the time based holdout, where shuffling a kept feature should hurt performance. A drift check, comparing the feature distribution in training against the last month of production traffic, because a feature whose meaning changed will degrade silently. And a cost check, measuring p99 scoring latency and feature retrieval time with the reduced set against the full set. If dropping a feature saves 60 ms of retrieval and costs 0.002 AUC, I drop it.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-6Given a dataset, how would you determine the key factors influencing customer churn?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
First I would pin down the churn definition before touching a model. Churn for a subscription or marketplace seller is not a column in the data. It is a decision I have to make explicit: no transaction or login for 90 days, explicit cancellation, or non-renewal at contract end. Each definition changes the label, the base rate and which factors can even be observed. I would state that assumption, then build a leakage-safe feature set, fit an interpretable model, and check whether the apparent drivers survive segmentation and a causal sanity check.
A single correlation ranking is not enough. Tenure will almost always correlate with churn, but that tells product nothing actionable. I need factors that are available before the churn window, measured the same way across cohorts, and stable when I control for confounders such as plan, price paid and acquisition channel.
Leakage-safe setup
I would split by time, not randomly. Train on customers observed in months 1 to 6, test on month 7 onward, and freeze features at a prediction point, for example 30 days before the label window opens. Anything recorded after that point is excluded, even if it looks predictive.
# Python 3.11, scikit-learn 1.5. Hypothetical churn dataset.
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
features = ["tenure_days", "orders_30d", "failed_payments_90d",
"support_contacts_90d", "plan", "acquisition_channel"]
X, y = df[features], df["churned_90d"]
pre = ColumnTransformer([
("num", "passthrough", ["tenure_days", "orders_30d",
"failed_payments_90d", "support_contacts_90d"]),
("cat", OneHotEncoder(handle_unknown="ignore"), ["plan", "acquisition_channel"]),
])
model = Pipeline([("pre", pre),
("lr", LogisticRegression(max_iter=1000, C=1.0))])
model.fit(X_train, y_train) # train period only, features frozen at prediction pointLogistic regression gives signed coefficients I can defend in the room. I would then run a tree model such as HistGradientBoosting as a check for non-linearity and interactions, and use SHAP values only to see whether the ranking agrees. If the two disagree sharply, I trust neither ranking until I find the interaction or the leak.
What the evidence looks like
Hypothetical figures from a worked example, base churn 8.0% in the test period:
| Factor (frozen at prediction point) | Test churn when present | Adjusted odds ratio | Caveat |
|---|---|---|---|
| Failed payment in prior 90 days | 21.4% | 3.1 | Check whether retry flow already intervened |
| Orders in prior 30 days = 0 | 16.8% | 2.4 | Partly definitional if churn is inactivity based |
| Support contact about billing | 13.2% | 1.7 | Confounded by plan and by payment failure |
| Tenure under 90 days | 14.6% | 1.9 | Segment by acquisition channel before acting |
| Visited cancellation page | 38.0% | 9.8 | Leakage if recorded inside the label window, exclude |
The cancellation page row is the trap. It is the strongest predictor in the raw data and useless for prevention, because by then the customer has decided. The same applies to a support ticket tagged "cancel" after the prediction point. I would report it in a leakage audit and remove it from the driver list.
From association to a driver I can act on
Three checks separate a real factor from a passenger.
-
Confounding. Price increases often land on long-tenure customers first. A raw model may blame tenure when the trigger was the bill. I would stratify by plan and price band, and compare churn before and after a price change within the same segment. If the effect disappears inside strata, it was not tenure.
-
Segment stability. Prosus operates across very different businesses, so a pooled model can hide opposite effects. I would fit or at least validate the model per business unit and per cohort, and look for Simpson's paradox: a factor that raises churn in every segment can appear protective in the pooled data if high-risk segments use it more.
-
Intervention evidence. For the top actionable factor, here failed payments, I would look for a natural experiment or run a small randomised retry and dunning test. If improving payment recovery cuts churn in the test group, the factor is causal enough to fund. If churn does not move, the payment failure was a symptom of a customer already leaving.
Failure modes I would name in the interview
Label leakage from post-decision events, as above. Survivorship bias if I only train on customers who survived to the data pull date. Class imbalance handled by reporting precision and recall at the operating threshold the retention team can actually contact, not by optimising AUC alone. And drift: a driver found in one quarter, such as a failed app release, should be flagged as time-bound rather than promoted to a permanent churn factor.
I would close with the deliverable: a short ranked list, each factor with its adjusted effect, the segment where it holds, the leakage and confounding checks it passed, and the one experiment I would run next. That is what turns a dataset into a decision.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-7How would you design an experiment to test the effectiveness of a new pricing strategy?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would start by pinning down the decision the test has to support. A new pricing strategy is not one treatment. It could be a lower list price, a discount shown at checkout, or a change in the fee a seller pays. Each changes a different behaviour, so I would ask which price, for which segment, and over what horizon, then write the hypothesis in those terms: for example, a 10% lower checkout price for first-time buyers in one category lifts paid conversion by at least 5% relative without lifting refunds.
The primary metric follows from that. For a buyer-facing price I would use paid conversion per eligible session, with revenue per session as the check that we are not buying conversion by destroying margin. For a seller fee change I would flip it: seller acceptance and listing supply first, buyer conversion second. Guardrails are set before launch, not after a bad result: refund rate, payment failure rate, repeat purchase within 30 days, and seller churn where sellers are affected.
Randomisation unit is the hard part in a marketplace like OLX or a payments product like PayU. Randomising by buyer when sellers see both prices breaks the stable unit treatment assumption. Sellers get confused, buyers compare prices across accounts, and the control group is contaminated. So I would randomise by the unit that actually experiences the price and can leak it: usually seller or geo cluster for seller-facing changes, and user for a purely buyer-facing discount that is not visible to sellers. If neither works cleanly, I would use a switchback design, alternating treatment by time block within a geo, and accept the wider confidence intervals.
Sizing it with real numbers
Suppose baseline paid conversion is 8.0% and we want to detect a 5% relative lift, which is 0.4 percentage points, at alpha 0.05 and 80% power. The two-proportion calculation gives roughly 72,000 eligible users per arm. That is the number I would put in the doc, with the assumptions stated, because it forces a conversation about whether the business can wait for it.
| Assumption | Value |
|---|---|
| Baseline conversion | 8.0% |
| Minimum detectable effect | +0.4 pp (5% relative) |
| Alpha / power | 0.05 / 0.80 |
| Required per arm | ~72,000 users |
| With CUPED, 30% variance cut | ~50,000 users |
CUPED is where I would spend effort before asking for more traffic. Using pre-experiment conversion as a covariate typically cuts variance 20 to 40% in checkout funnels, which is cheaper than running the test twice as long.
# CUPED adjustment, checked against a simple two-arm test
import numpy as np
def cuped(y, x, theta=None):
# y: outcome, x: pre-period covariate, both aligned per user
if theta is None:
theta = np.cov(y, x)[0, 1] / np.var(x)
return y - theta * (x - x.mean()), theta
# y_adj, theta = cuped(y, x_pre)
# then compare y_adj between arms with a standard t-test or regression
# including the covariate directly gives the same variance reductionHow I would run and read it
Stratification matters because price elasticity differs by category and income band. I would stratify by geo, category, and pre-period conversion decile, and check covariate balance on day one. Analysis is intention to treat: everyone assigned to treatment counts, even if they never saw the new price, because excluding non-compliers reintroduces selection bias.
Three failure modes I would name up front. First, interference: buyers in control seeing treatment prices through a shared household account or a seller listing both. I would measure cross-arm exposure in logs and, if it exceeds a few percent, move to cluster randomisation. Second, novelty and seasonality: a launch week spike that fades, or a payday effect. I would run at least two full weekly cycles and look at week one versus week two separately. Third, peeking: checking significance daily and stopping on a lucky day. I would pre-register the end date and use a sequential method if the business insists on interim looks.
Finally, I would not declare victory on conversion alone. A price cut that lifts conversion 6% but drops revenue per session 4% and raises refunds is a worse business. The readout has to show the primary metric, revenue per session, and each guardrail with confidence intervals, plus the segment split, so product can decide whether to ship everywhere or only where elasticity is high.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-8Describe a time when you had to solve a difficult data-related problem. What was your approach?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
At my last role I owned a default model for a buy-now-pay-later portfolio, about 400,000 loans a year. Offline AUC was 0.93. In production, after six weeks, it was 0.61 and the approval rate had drifted 9 points. The business wanted a bigger model. I argued we had a data problem first, and I spent two weeks proving it before touching the algorithm.
My approach was to reproduce the live decision exactly, then compare it line by line with training. I rebuilt the scoring path from raw tables, checked when every feature became available, and checked whether every label had had time to occur. That found two faults. First, leakage. Second, immature labels. Fixing both dropped offline AUC to 0.78, which looked worse on paper, and live AUC rose to 0.77. That gap closing was the real result.
What I checked, in order
I started with the decision timestamp, not the model. For a sample of 20,000 scored loans I pulled the feature values as stored in the training table and as returned by the online store at scoring time. Where they differed, I asked which timestamp the value carried.
| Feature | Available at origination | In training table | Finding |
|---|---|---|---|
| Credit bureau score | Yes | Yes | Clean |
| Basket size, merchant category | Yes | Yes | Clean |
| Repayments in first 30 days | No | Yes | Leaky, post-decision |
| Collections contact flag | No | Yes | Leaky, post-decision |
| Days since first missed payment | No | Yes | Leaky, target proxy |
Three of the top five features by importance were not knowable at scoring time. The model had learned to recognise a loan that was already failing. That explains most of the 0.93.
The second fault was label maturity. Default was defined as 90 days past due, but the training extract included loans originated in the last 90 days coded as non-default simply because they had not yet had time to default. In that extract, 18% of loans were immature, and their observed default rate was 0.4% against 6.1% for mature loans. The model was being rewarded for predicting recent loans as safe.
I made the check permanent in the pipeline:
# Point-in-time audit, run on every training build
# features: one row per loan per feature, with feature_ts
# decisions: loan_id, decision_ts, label, label_mature_ts
merged = features.merge(decisions, on="loan_id", how="inner")
leaky = merged[merged["feature_ts"] > merged["decision_ts"]]
immature = decisions[decisions["label_mature_ts"] > decisions["extract_ts"]]
assert leaky.empty, f"{len(leaky)} leaky feature rows"
assert immature.empty, f"{len(immature)} immature labels"Training then used an as-of join on feature_ts <= decision_ts and dropped immature loans entirely, rather than coding them as negatives.
The trade-off I had to defend
Dropping immature loans meant waiting 90 days for a clean label, so the model trained on older behaviour. The alternative was a proxy label at 30 days past due, which arrives faster but misses late defaults and biases the model toward early, visible distress. I kept the 90-day definition for the production model and used the 30-day proxy only as a monitoring signal, with a clear note that it was not comparable to the target. I also kept the model simple, logistic regression on about 25 audited features, because the priority was a feature set I could defend to risk and audit. A gradient boosting model on the same clean features gave AUC 0.79 against 0.78, a gain not worth the extra monitoring surface at that stage.
How I knew it was fixed
I backtested with a strict time split, training on loans originated before a cutoff and testing only on loans whose full 90-day window had closed before the extract. Offline AUC 0.78, live AUC 0.77 over the next eight weeks, and the approval rate returned to the policy band. I added two production monitors that would have caught the original faults: the share of scored loans with any feature timestamp after the decision, which must stay at zero, and the default rate split by loan age at extract, which should be flat once maturity is handled.
The lesson I took from it, and the one I would apply here, is to distrust a large offline to live gap as a modelling problem until you have audited timestamps and label maturity. In this case the difficult part was not choosing an algorithm. It was showing, with a reproducible trace, that the training data described a different decision from the one we were making in production.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-9Tell me about a project where you had to collaborate with cross-functional teams. What was your role?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I was the data scientist on a credit decisioning project at a fintech lending business, six months, team of product manager, two engineers, a risk analyst and a compliance lead. My role was not to hand over a model. I owned the decision problem, the evaluation, and the monitoring plan. Product owned the business constraints, engineering owned the serving path, risk owned the cutoffs. That split mattered because the model was easy. Getting it into production without breaking approval rates or regulatory reporting was the work.
The problem: manual underwriting for small merchant loans, 3,000 applications a month, decision in 48 hours, default rate 8.2% at 90 days. Product wanted faster decisions and higher approvals. Risk wanted defaults down. Those pull in opposite directions, so we agreed the objective in writing before any modelling: maximise approval rate subject to 90-day default staying at or below 7.5% on a holdout, and decision time under 5 seconds at p99.
What I actually did
First two weeks I sat with risk analysts and read 200 declined and approved cases. The manual scorecard used bureau data and six months of transaction history, but analysts also used signals that never reached the warehouse, like repeated failed settlements in the last 14 days. I defined the target as default within 90 days of disbursement, excluded loans still in their first 30 days to avoid label leakage, and built a time-based split. Random split would have leaked, because the same merchant appears in consecutive months.
I trained a gradient boosting model on 41 features, but the deliverable was a comparison table we reviewed together. Logistic regression was within 0.008 AUC of the boosted model and far easier for compliance to explain to the regulator. We shipped the boosted model only after adding SHAP reason codes per decision, because every decline needed a reason the merchant could act on.
| Decision | Owner | Artefact that settled it |
|---|---|---|
| Target definition and label window | Me, signed off by risk | One-page spec with leakage exclusions |
| Approval cutoff | Risk, with my impact curve | Approval vs default table at 10 cutoffs |
| Feature store and serving | Engineering | Batch feature job, 4-hour freshness SLA |
| Decline reason codes | Compliance + me | Top 3 SHAP codes mapped to merchant actions |
| Rollout | Product | 10% traffic for 2 weeks, then 50%, then 100% |
The cutoff argument is where cross-functional work usually breaks. Product pushed for a cutoff giving 48% approvals. My curve showed that at that cutoff, projected default was 8.9%, above the agreed 7.5% ceiling. We did not debate opinions. We ran the holdout numbers:
| Cutoff (score) | Approval rate | Projected 90-day default |
|---|---|---|
| 0.30 | 48% | 8.9% |
| 0.40 | 41% | 7.4% |
| 0.50 | 34% | 6.1% |
We chose 0.40. Expected loss per 1,000 applications at 0.40: 410 approved, 30 defaults. At an average loan of 12,000 and 45% loss given default, that is about 162,000 in expected loss against 410 loans served. At 0.30 we would serve 70 more loans but add roughly 13 defaults, which wiped out the margin on the extra volume. Risk accepted 0.40, product accepted it because the arithmetic was on one page.
Failure modes I had to name
Two things went wrong in shadow mode. First, feature freshness. Engineering's batch job ran every 4 hours, but settlement failures arrived intraday. In shadow, 6% of decisions used stale values and the score shifted by more than 0.1 for 1 in 12 merchants. We added a freshness check: if the settlement feature is older than 6 hours, the application routes to manual review instead of auto-decline. Second, drift. After a festival season, transaction volumes rose 30% and the score distribution shifted. I set a weekly population stability index check on the top 10 features, with a threshold of 0.25 triggering a review with risk, not an automatic retrain.
Result and my reflection
Live after 10 weeks: approval rate 34% to 41%, median decision time 48 hours to 4 seconds, 90-day default 7.1% on the first 8,000 loans, inside the ceiling. The part I would do differently: I should have involved compliance in week 1, not week 4. Reason codes changed the feature set, because two of the strongest predictors had no merchant-actionable explanation. We dropped one and lost 0.004 AUC. Cheaper to learn that in week 1 than after the model was built.
If an interviewer asks what my role was, that is the honest answer. I owned the problem framing, the evaluation and the monitoring. I did not own the cutoff, the pipeline or the launch date, and the project worked because those boundaries were explicit from the start.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-10Describe a situation where you faced a significant challenge in your work. How did you handle it?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I owned a credit risk model for a lending product scoring about 120,000 applications a month. Offline validation looked clean, AUC 0.91 on a holdout from the previous quarter. Two weeks after launch, early repayment defaults in the first 30 days doubled, and the operations team was seeing approvals for applicants our old scorecard would have rejected outright.
The challenge was not the model code. A partner data feed had silently changed the definition of one input, income band, in week 6. Values that used to mean monthly income in local currency arrived as annual income for a subset of new applicants. The model read them as very high earners. No pipeline error fired because the schema, types and ranges all still passed.
I did three things in order. First, I froze the blast radius. We routed the affected segment to the previous scorecard plus a manual review rule for income above a threshold, rather than rolling back the whole model and losing the gains elsewhere. Second, I proved the cause with a trace, not a hunch. Third, I rebuilt validation so this class of break is caught before launch.
| Week | Applications scored | 30-day default rate, approved | Share with income band = top decile | PSI on income band vs training |
|---|---|---|---|---|
| 4, pre-launch shadow | 28,000 | 1.9% | 10.1% | 0.03 |
| 6, first live week | 31,000 | 2.1% | 10.4% | 0.05 |
| 7 | 30,000 | 3.4% | 18.7% | 0.31 |
| 8, after segment fallback | 29,000 | 2.0% | 11.2% | 0.09 |
PSI here is population stability index, sum over bins of (actual share minus expected share) times log(actual/expected). Above 0.25 we treat the feature as broken until explained. The arithmetic made the decision easy. At 30,000 applications a month, moving the default rate from 1.9% to 3.4% on roughly 60% approvals is about 270 extra defaults a month. At an average loss of 850 per default, that is roughly 230,000 a month in extra expected loss, against a manual review cost of about 6 per routed case.
# Python 3.11, checked against pandas 2.2
import numpy as np
def psi(expected, actual, bins=10):
edges = np.quantile(expected, np.linspace(0, 1, bins + 1))
edges[0], edges[-1] = -np.inf, np.inf
e = np.histogram(expected, edges)[0] / len(expected)
a = np.histogram(actual, edges)[0] / len(actual)
e, a = np.clip(e, 1e-4, None), np.clip(a, 1e-4, None)
return float(np.sum((a - e) * np.log(a / e)))That check now runs nightly per feature, not just at training time, and it pages the model owner when PSI crosses 0.25 for two consecutive days. We also added a contract test on the feed: income band must be consistent with declared loan amount and employment type within a tolerance band, and any partner schema change needs a version bump we can pin to.
What I would do differently, and what I would not
Retraining on the corrupted weeks would have been the fastest fix and the wrong one. It would have taught the model that high income predicts default. I kept those rows quarantined, relabelled the segment once the partner confirmed the change, and only then retrained, which brought AUC back to 0.90 on clean data and, more importantly, restored calibration in the top decile.
The failure mode I watch for now is a silent semantic change with no schema change. Types and null rates do not catch it. Distribution checks per feature, plus one business sanity check that a human can read, do. In this case that check was approval rate by income band. It moved from 71% to 89% in the top band in a week when nothing in pricing or marketing had changed. That single chart got the incident declared faster than any model metric.
If an interviewer pushes on ownership, the honest version is that I missed the pre-launch check. We had drift monitoring on the score, not on the inputs. The fix I am proud of is not the fallback. It is that the same break today pages us on day one, while the model is still in shadow.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-11How do you prioritize tasks when working on multiple projects?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I start by making the competing claims explicit, then I score them on the same scale. For each project I ask the sponsor for four things: the decision it will change, the date that decision is locked, what happens if we miss that date, and what data or access I still need. If a sponsor cannot name a decision, the work is usually reporting in disguise, and it goes to the back of the queue or gets automated.
Then I rank by expected value per week of my time, adjusted for deadline risk. Expected value is the business value if it works, multiplied by my honest probability that the data and method will deliver it, divided by the weeks it will take. A hard external deadline, such as a regulatory submission or a partner contract, can override the score, but I state that override out loud so the displaced project gets a new date rather than silently slipping.
I also cap work in progress. I run at most two active modelling or experiment projects at once. A third slot is for ad-hoc questions, time-boxed to half a day. Anything beyond that waits in a visible queue that I review with stakeholders every Friday. That review is where priorities actually change, because new information arrives there, not in my head during the week.
A worked trace
Suppose I have three requests in one week, all plausible. I score them as follows. The figures are illustrative, but the arithmetic is the point.
| Project | Value if it works | P(success) | Weeks | Expected value per week | Deadline pressure |
|---|---|---|---|---|---|
| Churn model for a lending portfolio | $400k annual loss avoided | 0.6 | 6 | $40k | Contract renewal in 8 weeks |
| Pricing experiment analysis | $250k uplift | 0.8 | 2 | $100k | Product launch in 2 weeks |
| Weekly stakeholder dashboard | $30k in saved analyst time | 0.95 | 3 to build, then maintenance | $9.5k | None |
The pricing experiment wins on score and on deadline. The churn model is second, and it starts next because its renewal date is fixed. The dashboard drops to third. I tell that sponsor directly: I can ship a version built on existing tables in two days, or a fuller version in three weeks after the experiment. Most sponsors pick the two-day version once the trade-off is priced in weeks.
The scoring itself is a few lines, and I keep the inputs in a shared sheet so the ranking is auditable rather than a matter of who asked last:
def priority(value, p_success, weeks, deadline_weeks=None):
ev_per_week = value * p_success / weeks
# A deadline inside the build window adds urgency, it does not change value.
urgency = 1.5 if deadline_weeks is not None and deadline_weeks <= weeks else 1.0
return ev_per_week * urgency
priority(400_000, 0.6, 6, deadline_weeks=8) # 40000.0, deadline outside build window
priority(250_000, 0.8, 2, deadline_weeks=2) # 150000.0, deadline inside build window
priority(30_000, 0.95, 3) # 9500.0How the week runs
Two failure modes come up often. The first is the loudest stakeholder. A senior sponsor escalates in a meeting and a project jumps the queue without a score. I counter by publishing the queue and the scores, so a jump requires an explicit trade: which project moves, and to when. The second is context switching. I have measured my own output dropping when I carry four concurrent analyses, because each one needs its data checks and experiment design held in memory. The two-slot limit is my guard against that, and the Friday review is where I check whether a project that looked high value is actually blocked on data access. A blocked project gets paused and the next one starts, rather than me spending a week chasing a pipeline owner while the queue stalls.
When a sponsor pushes back, I do not defend my calendar. I show the table, ask which input they disagree with, and re-run the ranking with their number. That keeps the conversation about value and dates, which is where prioritisation should be decided.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-12Write a function to calculate the correlation coefficient between two variables?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
Assume paired numeric observations, one value per unit, with missing values already decided on. Pearson's r measures linear association: covariance divided by the product of standard deviations. It is bounded in [-1, 1], symmetric, and invariant to shifting or rescaling either variable. I would write it from scratch, then check it against numpy.corrcoef or pandas.Series.corr on the same data.
import math
def pearson(x, y):
"""Pearson correlation for paired sequences. Returns float in [-1, 1]."""
if len(x) != len(y):
raise ValueError("x and y must have the same length")
n = len(x)
if n < 2:
raise ValueError("need at least two paired observations")
mx = sum(x) / n
my = sum(y) / n
sxy = sum((a - mx) * (b - my) for a, b in zip(x, y))
sxx = sum((a - mx) ** 2 for a in x)
syy = sum((b - my) ** 2 for b in y)
if sxx == 0 or syy == 0:
return float("nan") # constant input: correlation is undefined
return sxy / math.sqrt(sxx * syy)The formula is r = sum((x - mean_x)(y - mean_y)) / sqrt(sum((x - mean_x)^2) * sum((y - mean_y)^2)). Using sums of squared deviations avoids computing standard deviations separately and keeps the code to one pass after the means.
Worked trace
Take x = [1, 2, 3, 4] and y = [2, 4, 5, 8]. Means are 2.5 and 4.75.
| i | x | y | x - mean_x | y - mean_y | product | (x-mean)^2 | (y-mean)^2 |
|---|---|---|---|---|---|---|---|
| 1 | 1 | 2 | -1.5 | -2.75 | 4.125 | 2.25 | 7.5625 |
| 2 | 2 | 4 | -0.5 | -0.75 | 0.375 | 0.25 | 0.5625 |
| 3 | 3 | 5 | 0.5 | 0.25 | 0.125 | 0.25 | 0.0625 |
| 4 | 4 | 8 | 1.5 | 3.25 | 4.875 | 2.25 | 10.5625 |
| sum | 9.5 | 5.0 | 18.75 |
r = 9.5 / sqrt(5.0 * 18.75) = 9.5 / 9.682 = 0.981. Strong positive linear association, which matches the scatter.
Which coefficient, and when Pearson misleads
| Coefficient | What it captures | Use it when | Watch out |
|---|---|---|---|
| Pearson | Linear association on raw values | Both variables roughly continuous, relationship looks linear | Sensitive to outliers and skew |
| Spearman | Monotonic association on ranks | Ordinal data, skewed distributions, monotonic but curved relationship | Loses information about magnitude |
| Kendall tau | Concordant vs discordant pairs | Small samples, many ties, ranking tasks | Slower to compute, harder to interpret as effect size |
Three failure modes come up in practice. First, a single outlier can flip the sign. A handful of very high spenders in a Prosus marketplace dataset can make spend and repeat purchase look strongly correlated when the bulk of users show none. I check this with a scatter plot and by recomputing r after trimming or winsorising the top 1%. Second, Pearson misses curved relationships. A U-shaped price response can give r near zero despite a clear pattern, so I plot before quoting a number. Third, pooling across segments creates Simpson's paradox. Price and conversion may correlate positively within each category yet negatively overall because expensive categories convert less. I compute r per segment as well as pooled.
For missing data, the function above assumes the caller has chosen a policy. Pairwise deletion is common for a quick correlation matrix, but it means different pairs rest on different n, which I report alongside r. For production code I would delegate to numpy or pandas, keep this version for interviews and debugging, and add a test with the trace above plus constant-input and mismatched-length cases.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-13Given a dataset, how would you implement a decision tree from scratch?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would clarify the target first: classification or regression, and whether features are numeric, categorical, or both. Assuming a tabular classification task, I would build a recursive tree that at each node searches every feature and every candidate threshold, picks the split with the largest impurity reduction, and stops on depth, sample count, or no gain. That is the whole algorithm. Everything else is how you make it not overfit and not leak.
import numpy as np
from collections import Counter
def gini(y):
if len(y) == 0:
return 0.0
p = np.bincount(y) / len(y)
return 1.0 - np.sum(p ** 2)
def best_split(X, y, min_leaf=5):
n, d = X.shape
parent = gini(y)
best = (0.0, None, None) # gain, feature, threshold
for j in range(d):
vals = np.unique(X[:, j])
if len(vals) < 2:
continue
thresholds = (vals[:-1] + vals[1:]) / 2.0
for t in thresholds:
left = X[:, j] <= t
if left.sum() < min_leaf or (~left).sum() < min_leaf:
continue
gain = parent - (left.mean() * gini(y[left]) + (1 - left.mean()) * gini(y[~left]))
if gain > best[0]:
best = (gain, j, t)
return best
def build(X, y, depth=0, max_depth=6, min_leaf=5):
node = {'pred': Counter(y).most_common(1)[0][0], 'n': len(y)}
if depth == max_depth or len(np.unique(y)) == 1 or len(y) < 2 * min_leaf:
return node
gain, j, t = best_split(X, y, min_leaf)
if j is None or gain <= 1e-9:
return node
left = X[:, j] <= t
node.update({'feature': j, 'threshold': t, 'gain': gain,
'left': build(X[left], y[left], depth + 1, max_depth, min_leaf),
'right': build(X[~left], y[~left], depth + 1, max_depth, min_leaf)})
return node
def predict_one(node, x):
while 'feature' in node:
node = node['left'] if x[node['feature']] <= node['threshold'] else node['right']
return node['pred']For categorical features I would one-hot encode for this exercise, or group rare categories first. One-hot keeps the threshold search above unchanged. Native categorical splits need a different search and are easy to get wrong under time pressure.
Worked trace
Suppose 10 labelled rows, 5 positive and 5 negative, so parent Gini is 0.50. A candidate split on tenure sends 6 rows left (5 positive, 1 negative) and 4 rows right (0 positive, 4 negative).
| Node | n | Pos | Neg | Gini | Weighted Gini |
|---|---|---|---|---|---|
| Parent | 10 | 5 | 5 | 0.500 | 0.500 |
| Left | 6 | 5 | 1 | 0.278 | 0.167 |
| Right | 4 | 0 | 4 | 0.000 | 0.000 |
Gain is 0.500 minus 0.167, which is 0.333. The right child is pure, so it becomes a leaf. The left child is split again or stopped by max_depth or min_leaf. That arithmetic is what best_split repeats for every feature and threshold, which is why the naive cost is roughly O(depth x features x n log n) if you sort per feature, and worse if you rescan naively.
Choices I would defend, and where it breaks
| Choice | Default I would state | Why |
|---|---|---|
| Criterion | Gini for classification, variance reduction for regression | Gini is fast and close to entropy in practice. Entropy gives cleaner information gain numbers but rarely changes the chosen split. |
| Stopping | max_depth=6, min_leaf=5 to 20 depending on n | A depth 6 tree has at most 64 leaves. On 10,000 rows that is a readable model. On 100 rows it still overfits. |
| Validation | Hold out 20 percent, stratified, before any tuning | Training accuracy on a deep tree will be near 100 percent and tells you nothing. |
| Pruning | Cost complexity pruning or a validation based depth search | Grow a little deep, then cut splits whose gain does not pay for complexity. |
Failure modes I would name without being asked: leakage through a feature computed after the label, for example a refund flag in a churn model; class imbalance, where Gini gain favours the majority class and a 95/5 split looks good while recall on the minority class collapses, so I would check per class metrics and consider class weights; unseen categories at prediction time, which one-hot handles as all zeros but a native split may not; and correlated features, where the tree picks one arbitrarily and feature importance then misleads stakeholders. At Prosus scale I would also say plainly that this implementation is for understanding and prototyping. For production tabular work I would compare it against gradient boosting and a regularised linear model on the same split, because a single tree is high variance: change 5 percent of the training rows and the top split can move.
If asked to extend it, I would add missing value handling by sending rows to the child that minimises impurity, and I would replace the recursive Python loop with sorted scans per feature before reaching for sklearn. The interview point is that the split search, the stopping rule, and the validation design matter more than the class boilerplate.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-14How do you optimize the performance of an algorithm?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would ask what performance means here before touching code. At Prosus scale that usually means one of three things: latency at p99 for a live model, throughput and cost per thousand predictions for batch scoring, or training time for iteration. The optimisation path differs for each, and I would not trade accuracy for speed without stating the exchange rate.
My default sequence is profile, fix the algorithmic bottleneck, then fix the implementation, then fix the hardware or serving layer. Most candidates jump to the last step. In practice the first two give 10x to 100x, the last gives 1.5x at much higher cost.
Profile before you optimise
Take a concrete case I would use in an interview: a churn or fraud scorer that scores 100,000 users overnight and also serves single predictions in a product flow. I would time it end to end and break it down by stage, because a model that is 90% of the runtime needs different work from one that spends 90% in feature joins.
# Python 3.11, run on a representative 100k-row sample
import time, cProfile, pstats, io
def bench(fn, *args):
t0 = time.perf_counter()
out = fn(*args)
return out, time.perf_counter() - t0
pr = cProfile.Profile()
pr.enable()
scores, elapsed = bench(score_batch, users) # hypothetical pipeline
pr.disable()
s = io.StringIO()
pstats.Stats(pr, stream=s).sort_stats("cumulative").print_stats(12)
print(f"elapsed={elapsed:.2f}s")
print(s.getvalue())If score_batch is dominated by a Python loop over users, no amount of server tuning helps. If it is dominated by a SQL feature join or a remote feature store call per user, no amount of model tuning helps either.
Worked trace: where the time actually goes
Hypothetical figures from a 100,000-user batch run, labelled as an example:
| Stage | Before | Share | After fix | Fix applied |
|---|---|---|---|---|
| Feature join (row by row) | 3.10 s | 74% | 0.22 s | Vectorised join on user_id, precomputed aggregates |
| Model inference (loop) | 0.85 s | 20% | 0.11 s | Single matrix call, float32 |
| Post-processing and write | 0.25 s | 6% | 0.18 s | Batched write |
| Total | 4.20 s | 100% | 0.51 s | 8.2x faster |
That trace changes the conversation. The model was never the problem. Optimising the model first would have wasted a week for a 0.1 s gain.
The optimisation ladder
| Technique | When it wins | Cost or risk |
|---|---|---|
| Better algorithm or data structure | n grows, loop dominates | Rewrite risk, needs correctness tests |
| Vectorisation and batching | Python loops over arrays | Memory spikes if batch too large |
| Caching and precomputation | Same features recomputed per request | Staleness, cache invalidation bugs |
| Quantisation, pruning, distillation | Large model, tight latency budget | Small accuracy drop, must revalidate by segment |
| Parallelism and bigger instances | CPU or IO saturated, proven bottleneck | Cost per prediction rises, cold starts |
Trade-offs I would state out loud
Speed is not free. Quantising a gradient boosting model from float64 to float32 or int8 might cut p99 from 180 ms to 60 ms in a hypothetical serving test, but I would check AUC and calibration overall and for the segments that matter, for example new users in a marketplace versus repeat buyers. If the drop is 0.002 AUC overall but 0.02 for a small segment, I would not ship it without a product decision.
Caching has a similar trap. Precomputing user aggregates hourly makes scoring fast, but a fraud model reading a 1-hour-old aggregate can miss the burst that matters. The fix is to name the freshness requirement first, then choose between real-time features, hourly precompute, or a hybrid.
Failure modes and how I would catch them
Optimising on a small sample that fits in cache, then hitting production data 50x larger and timing out. I profile on a full day of production traffic, not a notebook sample.
A faster model that silently changes predictions because of a dtype or preprocessing mismatch between training and serving. I keep a golden set of 1,000 labelled cases and require prediction agreement above a threshold before and after any optimisation.
Throughput gains that break p99 under load because batching adds queueing delay. I load test at 2x peak traffic and report p50, p95 and p99 together, never a mean alone.
I would close by asking the interviewer which constraint binds in their system, latency, cost, or iteration speed, because that decides which rung of the ladder to climb first.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-15Calculate the monthly spending trends for customers using window functions and joins?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would start from a transactions table, aggregate to one row per customer per month, then use window functions over that monthly series to get trend. The join matters because I need customer attributes and I need to avoid fan-out, and the window functions matter because trend is a comparison between months, not a value inside one month.
Assume orders(order_id, customer_id, order_date, amount, status) and customers(customer_id, country, signup_date). Amount is in minor units or a single currency per row, and I filter to completed orders before aggregating. That assumption decides the result, so I state it first.
-- PostgreSQL 15
WITH monthly AS (
SELECT
c.customer_id,
c.country,
date_trunc('month', o.order_date)::date AS month,
SUM(o.amount) AS spend,
COUNT(*) AS orders
FROM orders o
JOIN customers c ON c.customer_id = o.customer_id
WHERE o.status = 'completed'
AND o.order_date >= CURRENT_DATE - INTERVAL '12 months'
GROUP BY c.customer_id, c.country, date_trunc('month', o.order_date)
)
SELECT
customer_id,
country,
month,
spend,
orders,
LAG(spend) OVER w AS prev_month_spend,
spend - LAG(spend) OVER w AS mom_change,
ROUND(100.0 * (spend - LAG(spend) OVER w) / NULLIF(LAG(spend) OVER w, 0), 1) AS mom_pct,
ROUND(AVG(spend) OVER (PARTITION BY customer_id ORDER BY month ROWS BETWEEN 2 PRECEDING AND CURRENT ROW), 2) AS spend_3m_avg,
SUM(spend) OVER (PARTITION BY customer_id ORDER BY month ROWS UNBOUNDED PRECEDING) AS spend_cumulative,
RANK() OVER (PARTITION BY month ORDER BY spend DESC) AS spend_rank_in_month
FROM monthly
WINDOW w AS (PARTITION BY customer_id ORDER BY month)
ORDER BY customer_id, month;The JOIN is before the GROUP BY, so each order contributes once. If I joined a second table with multiple rows per customer, for example customer_tags, the join would duplicate orders and inflate SUM(amount). That is the classic fan-out failure. I would check it by comparing COUNT(*) before and after the join, or by aggregating orders first and joining the aggregated result to customers.
The window functions do the trend work. LAG gives last month for the same customer, which gives month-on-month change. The frame ROWS BETWEEN 2 PRECEDING AND CURRENT ROW gives a rolling 3-month average without collapsing rows. RANK answers a different question, how this customer compares with everyone else that month, and it needs PARTITION BY month instead of PARTITION BY customer_id.
Worked trace for one customer, amounts in cents converted to euros for readability:
| month | spend | prev_month_spend | mom_pct | spend_3m_avg | spend_cumulative |
|---|---|---|---|---|---|
| 2026-01 | 120 | NULL | NULL | 120.00 | 120 |
| 2026-02 | 180 | 120 | 50.0 | 150.00 | 300 |
| 2026-03 | 90 | 180 | -50.0 | 130.00 | 390 |
| 2026-04 | 270 | 90 | 200.0 | 176.67 | 660 |
January has no LAG value, so mom_pct is null rather than zero. That distinction matters in a dashboard. Zero would claim the customer spent nothing the month before, null says there is no prior month in the window.
Three failure modes come up in interviews and in production. First, sparse months. A customer who buys in January and March but not February has no February row, so LAG in March returns January and the change is mislabelled as month-on-month. If the business needs a true calendar trend, I build a month spine with generate_series and left join the monthly aggregates onto it, filling missing months with zero spend. If the business only cares about consecutive purchase months, I keep the sparse version and say so.
Second, refunds and cancellations. Filtering status = 'completed' at order level is not enough if refunds live in a separate table. Then I subtract refund amounts in the same monthly aggregation, or I use a signed amount column, and I decide whether a refund counts in the month it was issued or the month of the original order. Mixing the two silently moves trend between months.
Third, time boundaries. date_trunc('month', order_date) uses the session timezone. For a marketplace with customers in several countries, a 31 January 23:30 UTC order is already February in Berlin. I would truncate on a stored UTC timestamp and state the timezone in the output, or truncate per customer timezone if the metric is defined locally.
For scale, on a table with hundreds of millions of rows I would partition orders by month, keep the 12-month filter selective, and pre-aggregate to the monthly grain in a scheduled job rather than running the window query live for a dashboard. The window sort is then over customer-month rows, which is orders divided by average orders per customer-month, a much smaller sort.
Follow-up I would expect: replace the rolling average with an exponentially weighted trend, or add a cohort view by signup month. Both reuse the same monthly CTE and change only the window frame or the partition.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-16Describe your approach for turning user feedback into a well-scoped feature, with clear prioritization, MVP definition, and success metrics?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I treat feedback as evidence about a problem, never as a spec for a solution. I cluster it, quantify how representative it is, score the underlying problem, then define the smallest test that would change a decision. If the test cannot be measured in four to six weeks, I cut scope until it can.
Take a concrete Prosus-style example. Sellers on a classifieds marketplace repeatedly ask for bulk listing tools. The request sounds like a feature. The problem underneath might be that repeat sellers retype the same photos and descriptions for every ad, and abandon drafts halfway.
1. From raw feedback to a quantified problem
I tag feedback by segment, tenure, and behaviour, then check who is actually speaking. In our hypothetical, 1,200 comments mention bulk listing in a quarter, but 78% come from the top 4% of sellers by volume. That is a vocal minority, and it matters for prioritisation. I join the comments to product data: median time to publish a listing is 11 minutes for repeat sellers, draft abandonment is 43%, and listings created from drafts convert to a sale 9 percentage points lower than listings published in one session.
Now the problem is measurable: repeat sellers lose time and abandon listings. Bulk upload is one possible fix. Templates, duplicate-listing, and photo reuse are others. I keep the problem statement and let the solution compete.
2. Prioritisation with real numbers
I score candidate solutions with RICE, but I show the inputs so product can challenge them.
| Candidate | Reach (sellers / quarter) | Impact (1-3) | Confidence | Effort (person-weeks) | RICE score |
|---|---|---|---|---|---|
| Duplicate listing | 18,000 | 2 | 80% | 6 | 4,800 |
| Bulk CSV upload | 6,500 | 3 | 50% | 14 | 696 |
| Saved photo library | 11,000 | 1 | 60% | 4 | 1,650 |
RICE here is Reach x Impact x Confidence / Effort. Duplicate listing wins despite being less requested, because it reaches more sellers with less build. I also add a guardrail check: does it help new sellers or only power sellers? If the top decile captures all the gain, I either segment the rollout or deprioritise.
3. MVP definition
The MVP tests one hypothesis: reusing a previous listing reduces time to publish and increases completed listings. Scope is deliberately narrow.
| In MVP | Out of MVP |
|---|---|
| Duplicate your last listing, edit fields inline | Bulk CSV upload |
| Reuse photos from the original ad | Cross-category templates |
| Available to sellers with 3+ listings in 90 days | Pricing or promotion automation |
| Logged events for start, edit, publish, abandon | Offline or mobile-native flow |
Each in-scope item maps to an event I can measure. If an item cannot be instrumented, it does not ship in the MVP.
4. Success metrics and the decision rule
I pre-register one primary metric, two guardrails, and the kill criterion before launch. Primary: listings published per active repeat seller per week. Guardrail one: duplicate or low-quality listing rate, measured by reports and takedowns within 7 days. Guardrail two: time to first sale for new listings, to catch cannibalisation of fresh inventory.
For the worked example, baseline is 1.8 listings per seller per week with a standard deviation of 2.4. To detect a 5% lift (0.09 listings) at 80% power and 5% significance, I need roughly 11,000 sellers per arm. That arithmetic decides feasibility. If I only have 3,000 eligible sellers, I either widen eligibility, extend the test, or accept that I can only detect a larger effect and say so upfront.
Rollout is randomised at seller level, 50/50, for at least two full weekly cycles to avoid weekday bias. I check novelty effects in week one separately from weeks two and three. A lift that disappears after week one is a novelty effect, not a product win.
Failure modes I watch for
Feedback skews toward users who are angry, active, or on support channels. Churned users, who often hold the most useful signal, rarely file feedback. I correct for this by sampling in-product prompts and by comparing feedback themes against behavioural cohorts that never complained.
A second failure mode is solution capture: stakeholders fall in love with bulk upload because it was requested by name. My defence is the problem statement and the RICE table. If duplicate listing delivers the outcome at a third of the cost, the requested solution loses on evidence.
A third is metric gaming. Sellers can publish more listings without selling more. That is why the primary metric pairs with quality guardrails and a downstream outcome, sale rate per listing, reviewed after the test ends. If listings rise 8% and sale rate falls 4 points, I call it a failure even if the primary metric is green.
I close every cycle with a written decision: scale, iterate, or kill, with the numbers that forced it. That record is what turns feedback into a learning system instead of a feature factory.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-17Diagnose a post-release KPI drop by separating instrumentation issues from real behavior changes and tracing the problem through the metric hierarchy?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would freeze the KPI definition first, then split the drop into three buckets in the first hour: did the data stop arriving, did the definition change, or did users actually do less. I would not start by explaining the drop to product. I would start by proving whether the number is trustworthy.
Assume a release shipped on Tuesday and completed orders per day falls 8% on Wednesday. My first checks run in parallel: event volume by client version, schema and null rates, and the funnel step where the loss appears. If the loss is concentrated in the new app version and an upstream event is missing or malformed there, I treat it as instrumentation until proven otherwise. If the loss appears across old and new versions, in server-side logs as well as the warehouse, and at one funnel step, I treat it as real behavior and trace it down the hierarchy.
1. Instrumentation checks
I compare the same query for the 7 days before release and the 2 days after, split by app_version, platform, and event_name. I look for:
- Event volume:
checkout_starteddown 12% whilepage_viewis flat suggests a tracking break, not fewer shoppers. - Schema drift: new field names, a renamed event, or a payload change that breaks the parser. Null rate on
user_idororder_idjumping from 0.2% to 6% will silently drop joins. - Duplicates and sampling: a retry change can double count, a sampling change can halve counts. I check
event_iduniqueness per user per day. - Ingestion lag and backfill: warehouse partitions arriving 6 hours late look like a drop in intraday dashboards. I check ingestion timestamp versus event timestamp.
- Consent and platform changes: a new consent banner or an iOS permission prompt can cut tracked events while server-side orders stay flat. That is why I reconcile against a server-side source of truth, such as the orders table or payment gateway records, not only client events.
-- SQL checked against BigQuery, adjust table names per brand
-- Compare event volume and data quality pre vs post release
WITH daily AS (
SELECT
DATE(event_ts) AS d,
app_version,
event_name,
COUNT(*) AS n_events,
COUNT(DISTINCT event_id) AS n_unique,
AVG(CASE WHEN user_id IS NULL THEN 1.0 ELSE 0 END) AS null_user_rate
FROM analytics.events
WHERE event_ts >= DATE_SUB(DATE '2026-01-06', INTERVAL 7 DAY)
AND event_ts < DATE '2026-01-08'
AND event_name IN ('page_view', 'checkout_started', 'payment_success')
GROUP BY d, app_version, event_name
)
SELECT * FROM daily ORDER BY event_name, app_version, d;If n_events falls but n_unique falls faster, duplicates were inflating the baseline. If null_user_rate spikes only on version 4.2, the release broke identity stitching.
2. Worked trace through the hierarchy
Hypothetical figures, labelled as such, for a marketplace KPI of daily orders. Orders are sessions multiplied by checkout start rate multiplied by payment success rate, using server-side records for the last step:
| Level | Metric | Pre (7d avg) | Post (2d avg) | Change | Read |
|---|---|---|---|---|---|
| North star | Orders per day | 10,000 | 9,200 | -8.0% | KPI drop confirmed |
| Driver | Sessions per day | 200,000 | 198,000 | -1.0% | Traffic is not the main cause |
| Driver | Checkout starts | 12,000 | 11,088 | -7.6% | Checkout start rate 6.0% to 5.6% |
| Driver | Payment success rate, server-side | 83.3% | 83.0% | -0.3 pp | Payment itself is flat |
| Diagnostic | Client payment_success events | 10,000 | 7,400 | -26% | Client logging undercounts post-release |
| Diagnostic | Client payment_success, v4.2 only | 5,000 | 2,300 | -54% | Loss concentrated in new version |
| Control | Server-side payment records | 10,000 | 9,200 | -8.0% | Matches orders, so server is consistent |
The arithmetic closes. At pre-release rates, 198,000 sessions would give 198,000 x 6.0% x 83.3% = 9,896 orders, so the session dip explains about 104 of the 800 lost orders. Holding sessions at 198,000 and applying the new 5.6% checkout start rate at the old 83.3% payment rate gives 9,237 orders, so the checkout drop explains about 659. The small payment rate move from 83.3% to 83.0% explains the remaining roughly 37. That tells product where to look first: checkout entry, not payment.
The client payment events tell a different story, and that gap is the instrumentation signal. Server records show payment success flat, while client events fall 26% and fall 54% on v4.2 alone. A callback that fires after the gateway response but is not logged when the screen changes would produce exactly that pattern.
3. Separating real behavior from noise, and the limits of the rule
If instrumentation checks pass, I segment the real drop. New versus returning users, Android versus iOS, payment method, geography, and first-time checkout users often reveal the mechanism. A drop only for new users on a new checkout flow is a product effect. A drop only for one payment method after a gateway change is an external dependency.
The version split and the control brand are tools, not guarantees. If there is no clean control brand, because the release went to all brands or the brands have different seasonality, I fall back to a staggered rollout, a geo holdout, or the pre-period with a day-of-week adjustment, and I say the estimate is weaker. If server-side records come from the same release, for example a backend change to the orders table, reconciliation against them proves nothing. Then I need a third source outside the release, such as payment gateway settlement files or finance records, and I treat both client and server numbers as suspect until that check lands. The decision rule also fails when client and backend ship together with no canary or feature flag, because version no longer isolates the cause. In that case I stop attributing and ask for a rollback or a flag-off test on a small cohort.
4. Failure modes I name explicitly
Delayed ingestion mimics a drop for hours. A timezone change in the ETL job shifts orders across midnight. A deduplication change in the warehouse removes legitimate repeat events. A/B test assignment leaking into the production metric mixes treatment and control. I check each one with a named query or a dashboard, not with a general statement about data quality.
My close would be the decision rule with its limits stated: if the drop is version-specific, event-specific, and absent in an independent server or gateway source, I file it as instrumentation and ask engineering for a client fix or backfill. If it is cross-version, present in that independent source, and isolated to one funnel step and one segment, I file it as real, quantify its contribution as above, and hand product a specific hypothesis to test. If no independent source exists, I say so and do not claim the split.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-18Analyze why a customer churn prediction model's recall fell from 78% to 65% while precision remained stable at 85%, and suggest improvements?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
Precision staying at 85% while recall drops from 78% to 65% tells me the model is predicting churn less often, not worse when it does predict it. Precision is TP / (TP + FP). If that ratio holds while TP falls, FP must have fallen in proportion. The model has become more conservative: fewer customers cross the decision threshold, so we miss more real churners (FN rises) but the customers we do flag are still right 85% of the time.
That pattern points first to a threshold or score shift, not to a sudden loss of discrimination. A pure loss of signal, where scores become random, would drag precision down with recall. Stable precision with falling recall is what you get when scores drift down, the threshold was raised, a feature pipeline started returning weaker values, or the churner population changed shape so the old boundary no longer covers them.
Worked trace: what the counts must look like
Assume a monthly scoring batch of 10,000 customers with 1,000 actual churners in both periods. This is a hypothetical illustration, labelled as such, to make the rates checkable.
| TP | FN | FP | Predicted churn | Precision | Recall | |
|---|---|---|---|---|---|---|
| Before | 780 | 220 | 138 | 918 | 780/918 = 85% | 780/1000 = 78% |
| After | 650 | 350 | 115 | 765 | 650/765 = 85% | 650/1000 = 65% |
Predicted positives fell by 153, TP by 130 and FP by 23. If instead FP had stayed at 138, precision after would be 650/788 = 82.5%. So the first check in the interview is to pull the raw confusion matrix and predicted-positive rate, not just the two headline metrics. A falling predicted-positive rate with stable precision confirms a conservatism shift.
How I would diagnose it, in order
-
Threshold and score distribution. Plot the score histogram for churners and non-churners in both periods and check the deployed threshold in config and code. A threshold change from, say, 0.50 to 0.60, or a model version that outputs probabilities on a different scale after recalibration, produces exactly this signature. I would also compute recall at the old threshold on new scores. If recall recovers to near 78% at a lower threshold, the ranking may be intact and only the operating point moved.
-
Prevalence and segment mix. If churn prevalence rose, recall can fall if the new churners come from a segment the model scores low, for example new fintech users acquired through a partner channel at Prosus, who churn for onboarding reasons rather than the usage decline the model learned on. I would break recall and precision down by segment, tenure, product and acquisition channel. Stable precision overall can hide one segment where recall collapsed.
-
Feature and label pipeline. Check feature drift with Population Stability Index per feature, missing-rate changes, and any feature that went constant or was backfilled with a default. A broken feature, such as days_since_last_login arriving as null and imputed to the mean, compresses scores toward the middle and pushes borderline churners below threshold. On the label side, check the churn definition and observation window. If the label window shortened, or churn is now defined by 30 days of inactivity instead of 60, some labelled churners have not yet shown the behaviour the features capture, so they look like false negatives.
# Python 3.11, scikit-learn 1.4. Diagnostic check on a labelled scoring batch.
from sklearn.metrics import confusion_matrix
def psi(expected, actual, bins=10):
import numpy as np
edges = np.quantile(expected, np.linspace(0, 1, bins + 1))
edges[0], edges[-1] = -np.inf, np.inf
e, _ = np.histogram(expected, bins=edges)
a, _ = np.histogram(actual, bins=edges)
e, a = e / e.sum(), a / a.sum()
return float(np.sum((a - e) * np.log((a + 1e-6) / (e + 1e-6))))
tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()
print(f"precision={tp/(tp+fp):.3f} recall={tp/(tp+fn):.3f} pred_pos_rate={(tp+fp)/len(y_true):.3f}")
for col in feature_cols:
print(col, round(psi(X_old[col], X_new[col]), 3))PSI above roughly 0.25 on a top feature, or a jump in its missing rate, is a strong lead. I would also compare score deciles: if the top decile still captures churn at the old rate, ranking is fine.
Improvements, matched to the cause
If the threshold moved, I would not retrain first. I would re-tune the threshold against the business cost. Churn work usually values a missed churner far above a false alarm, because retention offers cost money but losing a customer loses lifetime value. I would pick the threshold that maximises expected value on a recent holdout, then lock it in config with an alert on predicted-positive rate.
If ranking degraded in a segment, I would retrain on recent data with segment-aware features, such as tenure interactions and channel, and consider class weighting or a lower threshold for the weak segment rather than one global cut. If a feature broke, fixing the pipeline and backfilling training data matters more than any model change, and I would add a data quality check that fails the batch when a top-20 feature is constant or missing above 5%.
For monitoring, I would track weekly: predicted-positive rate, score mean by segment, PSI on the top features, and recall and precision on matured labels with the lag made explicit. Recall computed on labels that are only 7 days old will always look worse than recall on 60-day labels, so the dashboard needs to compare like with like. That lag issue alone has explained more than one apparent recall drop I have investigated.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-19Build a supervised classification model to predict 12-month loan default using credit, financial, and application features?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I would frame it as a point-in-time prediction problem, not a modelling contest. Define the label first: default within 12 months of disbursement, for example 90+ days past due or a restructuring, and exclude loans that were prepaid or written off early from the denominator or censor them explicitly. Every feature must be knowable at application time. Anything generated after disbursement, repayment behaviour, collections notes, later bureau pulls, is leakage and will inflate validation AUC while failing live.
Then I would split by time, not randomly. Train on loans originated in months 1-18, validate on 19-24, test on 25-30, with a 12-month gap handled by only counting defaults observed by the cut-off. Random splits leak macro conditions and repeat borrowers across folds.
For a first production model I would use a regularised logistic regression as the benchmark and gradient boosting (LightGBM or XGBoost) as the challenger. Logistic regression gives calibrated probabilities and a clear audit trail for adverse action reasons. Boosting usually wins on non-linear interactions between income, loan size and bureau history, but needs calibration before it can be used for pricing or provisioning.
# Python 3.11, scikit-learn 1.4, LightGBM 4.3
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.calibration import CalibratedClassifierCV
numeric = ["income", "loan_amount", "term_months", "dti", "bureau_score"]
categorical = ["country", "loan_purpose", "employment_type"]
pre = ColumnTransformer([
("num", Pipeline([("imp", SimpleImputer(strategy="median")),
("sc", StandardScaler())]), numeric),
("cat", Pipeline([("imp", SimpleImputer(strategy="most_frequent")),
("oh", OneHotEncoder(handle_unknown="ignore"))]), categorical),
])
model = Pipeline([
("pre", pre),
("clf", LogisticRegression(max_iter=1000, class_weight="balanced")),
])
# Fit on train period only. Calibrate on the validation period,
# never on the test period, then freeze both for scoring.
model.fit(X_train, y_train)
calibrated = CalibratedClassifierCV(model, method="isotonic", cv="prefit")
calibrated.fit(X_valid, y_valid)What I would report, and why AUC alone is not enough
Default rates in consumer portfolios are often 3-8%, so a model can look good on accuracy by predicting nobody defaults. I would report PR-AUC, ROC-AUC, and calibration in deciles, plus the business metric: expected loss at the operating threshold.
Expected loss = sum over loans of p(default) x loss_given_default x exposure. That converts a probability into money and lets credit risk set a cut-off. A threshold that maximises F1 rarely minimises expected loss, because missing a default on a large loan costs far more than a false alarm on a small one.
Worked example, hypothetical figures for a validation set of 10,000 loans, 5% default rate, average exposure R50,000, loss given default 60%:
| Threshold on p(default) | Flagged | Precision | Recall | Expected loss captured |
|---|---|---|---|---|
| 0.05 | 2,400 | 0.14 | 0.67 | 68% |
| 0.10 | 1,500 | 0.21 | 0.63 | 61% |
| 0.20 | 800 | 0.34 | 0.54 | 52% |
| 0.30 | 450 | 0.45 | 0.41 | 38% |
At 0.10 we flag 15% of applicants and capture most of the loss. Whether that is acceptable depends on capacity to review or decline, and on the margin on good loans we turn away. I would present that trade-off curve to risk, not a single threshold.
Failure modes I would check before shipping
Leakage through target encoding. If loan_purpose or lender branch is encoded with default rates computed on the full dataset, validation is contaminated. I would compute encodings inside each training fold only, or drop high-cardinality fields.
Population drift. Prosus portfolios span markets with different bureau coverage. A bureau_score that is predictive in South Africa may be missing for 40% of applicants in another market. I would evaluate performance by country and by thin-file versus thick-file segment, and add missingness as a signal rather than imputing silently.
Label delay. A loan originated 6 months ago cannot yet be a 12-month default. Training on recent loans without accounting for censoring biases the model toward good outcomes. I would either restrict training to fully matured cohorts or use a survival or discrete-time hazard formulation as a follow-up.
Calibration drift after a macro shock. Probabilities fitted in a benign year will understate risk when unemployment rises. I would monitor calibration monthly, track population stability index on the top features, and set a trigger to refit or adjust the intercept when observed default rates diverge from predicted by more than a pre-agreed band.
If boosting beats logistic regression by less than about 0.01 PR-AUC after calibration, I would ship the simpler model. The gain does not justify weaker explainability when a declined applicant or a regulator asks why.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-20What statistical techniques do you use for hypothesis testing?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I start from the decision, not the test. What is the unit of randomisation, what is the primary metric, what effect size would change the decision, and what guardrails must not move. Then I pick the test that matches the data generating process, pre-register the analysis, and report an effect size with a confidence interval alongside any p-value.
In product work at a consumer internet group that usually means A/B tests on conversion, revenue per user or take rate, plus offline model comparisons. The workhorses are the two-proportion z-test or chi-square test for binary outcomes, Welch's t-test for continuous outcomes with unequal variances, and, when assumptions fail, a permutation test or bootstrap. For more than two groups I use ANOVA or Kruskal-Wallis, and for repeated or clustered data I move to a regression model with cluster-robust standard errors rather than pretending rows are independent.
Choosing the test
| Situation | First choice | Why, and when to switch |
|---|---|---|
| Binary outcome, two groups, large n | Two-proportion z-test, equivalent to chi-square on a 2x2 table | Fast, well powered. Use Fisher's exact test when expected counts are below about 5. |
| Continuous outcome, two groups | Welch's t-test on the mean | Does not assume equal variances. If the metric is heavily skewed, such as revenue per user with a long tail, test the mean with a bootstrap or permutation test, because the mean is still the business quantity. |
| Continuous outcome, skewed, small n, or ordinal | Mann-Whitney U | Tests stochastic ordering, not the mean. Do not report it as a test of means. |
| Three or more groups | One-way ANOVA, or Kruskal-Wallis if assumptions fail | Follow up with pre-specified pairwise contrasts with multiplicity control, not all pairs at alpha 0.05. |
| Randomisation at user, seller or city level with many rows per unit | Regression with cluster-robust standard errors, or a cluster-level permutation test | Row-level tests understate variance when observations within a cluster correlate. |
| Sequential monitoring or many metrics | Alpha spending or always-valid methods, plus Benjamini-Hochberg for secondary metrics | Repeated peeking at p < 0.05 inflates false positives well above 5%. |
A worked example
Suppose a checkout change is randomised 50/50, 10,000 users per arm. Control converts 800 users (8.0%), treatment converts 880 (8.8%).
| Quantity | Value |
|---|---|
| --- | --- |
| --- | --- |
| Observed difference | +0.8 percentage points |
| Pooled proportion under H0 | 0.084 |
| Standard error of difference | sqrt(0.084 x 0.916 x (1/10000 + 1/10000)) = 0.0039 |
| z statistic | 0.008 / 0.0039 = 2.04 |
| Two-sided p-value | 0.041 |
| 95% confidence interval | +0.03 to +1.57 percentage points |
I would report that interval, not just p = 0.041. It says the lift is plausibly anywhere from negligible to 1.6 points, which matters when the change costs engineering time or shifts take rate. Before trusting it I check sample ratio mismatch (10,000 vs 10,000 here, so no signal of broken randomisation), pre-period balance, and whether the effect is driven by one segment or one day.
# Python 3.11, statsmodels 0.14
from statsmodels.stats.proportion import proportions_ztest, confint_proportions_2indep
count = [880, 800] # conversions: treatment, control
nobs = [10000, 10000]
stat, pval = proportions_ztest(count, nobs, alternative='two-sided')
low, high = confint_proportions_2indep(880, 10000, 800, 10000, method='wald')
print(f"z={stat:.2f}, p={pval:.3f}, 95% CI for difference: [{low:.4f}, {high:.4f}]")Power, and the failures I watch for
I size a test before launch. To detect a lift from 8.0% to 8.8% with 80% power at alpha 0.05 needs roughly 19,000 users per arm, so a 10,000 per arm test is underpowered for that effect and a non-significant result would be uninformative. That calculation goes in the experiment brief with the minimum detectable effect.
The recurring failure modes are concrete. Peeking daily and stopping at the first p < 0.05. Testing 20 metrics and reporting the one that moved. Ignoring interference, for example a pricing test where treated sellers affect control buyers in the same marketplace, which calls for cluster or switchback randomisation. And treating a statistically significant 0.1 point lift as a win when the confidence interval sits below the cost threshold. For model work I add the same discipline: hold out a test set, compare against a simple baseline, and use paired bootstrap or DeLong's test for AUC differences rather than eyeballing two scores.
Bayesian methods come up in follow-ups. I use them when a posterior probability of beating a threshold, or a credible interval for expected loss, is the actual decision input, and I state the prior. For a standard two-arm product decision with a pre-registered metric, the frequentist test plus interval is usually the clearer answer to defend in the room.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Q&A-21Describe the process of building a machine learning model from start to finish?
Reported in PROS Data Scientist Interview Questions & Guide 2026
The 90-second answer
I start with the decision the model will change. At Prosus that could be approving a PayU loan, ranking an OLX listing, or blocking a fraudulent payment. I write down the unit of prediction, the action taken at a given score, the cost of a false positive against a false negative, and the business metric that score should move. If we cannot name the action, I do not build a model.
From there the sequence is problem framing, data, baseline, validation, deployment, and monitoring. Each stage has a check that can stop the project.
| Stage | What I produce | Check that can stop it |
|---|---|---|
| Framing | Target definition, decision threshold range, primary and guardrail metrics | Target uses information unavailable at decision time |
| Data | Point-in-time feature table, train and test split by time and entity | Leakage or a feature that will not exist in production |
| Baseline | Simple rule or logistic regression, costed on the business metric | No gain over the current heuristic |
| Model | Tuned model with calibration, error analysis by segment | Gains come from one segment and harm another |
| Deployment | Batch or online scoring, shadow mode, rollback plan | Latency, cost, or data freshness breaks the decision |
| Monitoring | Drift, calibration, and outcome tracking by cohort | Score distribution shifts and nobody owns the response |
Data and leakage. For a loan default model, I define the label at application time and build features only from data available before that moment. A feature such as "amount repaid in the first 30 days" would leak the outcome. I split by time, not randomly, and I keep all applications from the same customer on one side of the split. Otherwise the model learns the customer, and offline accuracy flatters it.
A baseline comes before tuning. A regularised logistic regression on credit history, income, and application features tells me whether the signal exists and gives a calibrated score I can explain to risk colleagues. I only move to gradient boosting if it beats that baseline on a time-held-out set by a margin that survives the cost of serving it.
# Python 3.11, scikit-learn 1.5. Point-in-time features are built upstream.
from sklearn.compose import ColumnTransformer
from sklearn.impute import SimpleImputer
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import OneHotEncoder, StandardScaler
numeric = ["income", "credit_history_months", "prior_loans"]
categorical = ["country", "product_type"]
preprocess = ColumnTransformer([
("num", Pipeline([
("imputer", SimpleImputer(strategy="median")),
("scaler", StandardScaler()),
]), numeric),
("cat", Pipeline([
("imputer", SimpleImputer(strategy="most_frequent")),
("onehot", OneHotEncoder(handle_unknown="ignore")),
]), categorical),
])
model = Pipeline([
("preprocess", preprocess),
("clf", LogisticRegression(max_iter=1000, C=0.1)),
])
model.fit(X_train, y_train) # X_train contains only pre-decision featuresValidation that matches the decision. I report the metric the business feels. For default prediction that is expected loss at a proposed approval threshold, not accuracy. I also check calibration in bins, because a score of 0.2 should mean roughly 20 percent of those applicants default. I slice results by country, product, and new versus repeat customer. A model that improves overall loss by approving more repeat customers while quietly worsening new-customer risk is a failure I want to see before launch.
Deployment and monitoring. I run the model in shadow mode first, scoring live traffic without changing decisions, and compare its scores and implied loss against the current process. Rollout is gradual by country or traffic share, with a rollback switch that restores the old rule without a code deploy. In production I track input drift, score distribution, calibration on matured outcomes, and the guardrail metric. For lending, outcomes mature months later, so I also track early proxies such as first repayment behaviour and flag when the applicant mix changes faster than the model was trained on. Retraining is triggered by measured degradation, not by a calendar.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.
Curated: · Written: · Reviewed: