← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Google DS interview that was basically one giant case study on vendor selection modeling. The question sprawled across like five different sub-problems and I kept second-guessing whether they wanted me to go deep on one part or stay broad across all of them.

Questions Asked (5)

Q1

You have historical order data and two third-party vendors. Design a decisioning model to choose between them for each incoming order, minimizing expected total cost while keeping SLA attainment at or above 95% and staying within a monthly budget cap. Write out the objective function explicitly, including price, expected late penalties, expected quality failure costs, and stockout costs.

Data ModelingTechnical Trade-offsSystem Design
Author's notes

This is where I spent most of my time and still felt like I left stuff on the table.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a constrained optimization: define the decision variables (which vendor to assign per order) and the objective function that minimizes expected total cost, including price, expected late penalties, expected quality failure costs, and stockout costs. Then incorporate the SLA and budget constraints, and propose a practical solution method such as a cost-sensitive classifier or linear programming, emphasizing how you would estimate the probabilities from historical data.

Pro tip: Mention that you would validate the model with a holdout set and simulate different scenarios to ensure robustness, and discuss how you would monitor and update the model as vendor performance drifts.

1. Define decision variables and objective

Clearly state that for each order i, we choose vendor j (binary variable x_ij). The objective is to minimize the sum over all orders of expected total cost: price_ij + P(late|i,j)*late_penalty + P(quality_fail|i,j)*quality_cost + P(stockout|i,j)*stockout_cost.

2. Estimate probabilities from historical data

Use historical order data to model P(late|i,j), P(quality_fail|i,j), and P(stockout|i,j) as functions of order features (e.g., time, location, product type) and vendor. Mention techniques like logistic regression, gradient boosting, or Bayesian methods.

3. Incorporate constraints

Add the SLA constraint: overall expected on-time rate >= 95%, which can be expressed as sum_i sum_j x_ij * (1 - P(late|i,j)) >= 0.95 * total_orders. Add the budget constraint: sum_i sum_j x_ij * price_ij <= monthly_budget_cap.

4. Solve the optimization problem

Since the problem is a binary integer program, discuss solution approaches: if small, use an LP solver; if large, use a greedy heuristic or Lagrangian relaxation. Alternatively, frame as a cost-sensitive classification where each order is assigned to the vendor with lower expected cost, then adjust to meet constraints.

5. Validate and monitor

Split data into train/validation/test, evaluate on test set, and simulate to check SLA and budget. Discuss monitoring and retraining as vendor performance changes.

Key Points to Mention

  • Explicit objective function with all cost components: price, expected late penalty, expected quality failure cost, expected stockout cost.
  • SLA constraint expressed as expected on-time rate >= 95%.
  • Budget constraint: total expected price <= monthly budget cap.
  • Use of historical data to estimate probabilities (e.g., late, quality failure, stockout) per vendor and order features.
  • Solution method: integer programming or cost-sensitive classification with constraints.
  • Validation and monitoring plan to ensure constraints are met and model adapts over time.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

What features would you use and what modeling approach would you take for this vendor selection problem? Justify your choice given class imbalance and the fact that the data distribution shifts over time.

Data ModelingTechnical Trade-offsA/B Testing & Experimentation
Author's notes

I pushed toward a cost-sensitive classifier predicting SLA miss probability, with a threshold set by the cost ratio rather than 0.5.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business objective and data constraints, then propose a modeling pipeline that explicitly handles class imbalance and temporal drift. Justify feature choices and model selection by linking them to robustness, interpretability, and performance under distribution shift.

Pro tip: Emphasize that you would monitor model performance over time and set up an automated retraining pipeline, because in dynamic environments, a model's shelf life is as important as its initial accuracy.

1. Clarify the problem and data

Ask about the definition of a 'good' vendor, the target variable, available features, and how far back the data goes. Confirm the evaluation metric (e.g., precision@k, recall, F1) given class imbalance.

2. Feature engineering for vendor selection

Propose features that capture vendor performance, reliability, cost, and risk, such as historical delivery times, defect rates, financial stability, and interaction terms. Use domain knowledge to create time-aware features (e.g., rolling averages).

3. Handle class imbalance

Discuss techniques like resampling (SMOTE, undersampling), class weighting, or using anomaly detection if the positive class is very rare. Choose based on the cost of false positives vs. false negatives.

4. Address temporal distribution shift

Recommend time-based validation (e.g., rolling window) and models that adapt over time, such as online learning or periodic retraining. Consider using temporal features and drift detection.

5. Select and justify the modeling approach

Compare options like gradient boosting (XGBoost, LightGBM) for tabular data, or a two-stage approach (classify then rank). Justify based on interpretability, scalability, and ability to handle imbalance and drift.

Key Points to Mention

  • Class imbalance techniques: resampling, class weights, and evaluation metrics like AUPRC instead of accuracy.
  • Temporal validation: use time-series split or walk-forward validation to simulate real-world deployment.
  • Feature engineering: incorporate time-decayed features and vendor-specific historical aggregates.
  • Model choice: tree-based ensembles for tabular data, with options for online learning or frequent retraining.
  • Monitoring and retraining: set up drift detection (e.g., PSI, KL divergence) and automated retraining triggers.
  • Business impact: align model outputs with decision thresholds based on cost-benefit analysis.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Historical routing decisions were made by a biased policy, not randomly. How do you handle that selection bias when learning from this data? Walk through how you'd estimate propensities and stabilize the weights.

Data ModelingTechnical Trade-offsRoot Cause Analysis
Author's notes

Blanked for a second here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Frame the problem as off-policy evaluation and emphasize the importance of correcting for selection bias using inverse propensity scoring (IPS). Walk through a practical pipeline: estimate propensities with a model, stabilize weights via clipping or normalization, and validate the approach.

Pro tip: Mention that propensity estimation should be done with cross-fitting to avoid overfitting, and always check the overlap/positivity assumption—if violated, consider alternative methods like doubly robust estimation.

1. Define the target estimand and assumptions

Clarify what you want to estimate (e.g., expected reward under a new policy) and state the key assumptions: positivity (overlap) and unconfoundedness. Acknowledge that historical data was generated by a biased policy, so direct estimation is confounded.

2. Estimate propensities

Fit a probabilistic model (e.g., logistic regression or gradient boosting) to predict the probability of each action given context, using the historical logging policy. Use cross-fitting to avoid overfitting and ensure unbiased propensity estimates.

3. Compute and stabilize weights

Calculate inverse propensity weights (1/propensity) for each logged action. Stabilize by clipping weights at a threshold (e.g., 95th percentile) or using normalized weights (dividing by the sum of weights) to reduce variance.

4. Apply off-policy evaluation

Use the stabilized weights in an IPS or doubly robust estimator to evaluate the new policy. Compare with other methods (e.g., direct method) and report confidence intervals.

5. Validate and diagnose

Check for positivity violations (propensities near 0 or 1) and assess weight distribution. Use sensitivity analysis to test robustness to unmeasured confounding and consider alternative estimators if needed.

Key Points to Mention

  • Inverse propensity scoring (IPS) and its role in correcting selection bias
  • Propensity estimation via logistic regression or tree-based models with cross-fitting
  • Weight stabilization techniques: clipping, normalization, and self-normalized IPS
  • Positivity/overlap assumption and diagnostics for violations
  • Doubly robust estimation as a variance-reduction alternative
  • Evaluation metrics: effective sample size, weight distribution, and confidence intervals

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you evaluate this model offline before deploying it, and how would you roll it out online safely given vendor capacity limits?

A/B Testing & ExperimentationSystem DesignTechnical Trade-offs
Author's notes

Time-based splits felt obvious so I said that quickly, then focused more on the constrained evaluation piece since that seemed like the harder part.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer in two parts: offline evaluation and online rollout. For offline, describe a rigorous validation process using holdout sets, cross-validation, and business-relevant metrics. For online, outline a phased rollout with A/B testing, guardrail metrics, and capacity-aware traffic allocation, emphasizing safety and vendor constraints.

Pro tip: Show maturity by discussing how you'd handle vendor capacity limits: propose a staged rollout with a small initial percentage, monitor for regressions, and have a kill switch. Also, mention the importance of aligning offline metrics with online success metrics to avoid surprises.

1. Define success metrics and constraints

Clarify offline and online metrics (e.g., AUC, CTR, revenue) and constraints like vendor capacity limits. Align with stakeholders on what 'safe' means.

2. Offline evaluation

Use holdout sets, cross-validation, and backtesting to assess model performance. Check for bias, robustness, and calibration. Simulate online metrics if possible.

3. Design phased rollout

Plan a staged rollout: start with a small canary group, then gradually increase traffic. Use A/B testing to compare against control. Incorporate vendor capacity limits by capping traffic or using queuing.

4. Monitor and iterate

Set up real-time monitoring for guardrail metrics (latency, error rates, business KPIs). Have a rollback plan. Analyze results and iterate.

5. Communicate and document

Share findings with stakeholders, document decisions, and ensure compliance with ethical and privacy guidelines.

Key Points to Mention

  • Offline metrics: precision, recall, AUC, calibration, business KPIs
  • Online metrics: CTR, conversion, revenue, guardrail metrics (latency, error rates)
  • A/B testing best practices: randomization, sample size, statistical significance
  • Phased rollout: canary, percentage ramp-up, kill switch
  • Vendor capacity limits: traffic shaping, queuing, prioritization
  • Monitoring and alerting: real-time dashboards, anomaly detection

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How do you handle cold start for a new vendor, and what would you investigate if vendor A looks cheaper in your model but late penalties are actually increasing in production?

Root Cause AnalysisData ModelingAdaptability & Ambiguity
Author's notes

Cold start I answered with priors from similar vendors plus conservative exploration, nothing fancy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining a structured approach to cold start for a new vendor, emphasizing data collection, baseline modeling, and iterative refinement. Then, for the discrepancy between model predictions and production outcomes, describe a systematic root cause analysis that checks data quality, model assumptions, and external factors. Highlight the importance of monitoring and feedback loops to adapt models in production.

Pro tip: Demonstrate proactive monitoring by mentioning that you'd set up automated alerts for late penalties and model drift, and that you'd collaborate with operations to understand the business impact beyond the model metrics.

1. Cold Start Data Strategy

For a new vendor, gather all available data (historical, industry benchmarks, vendor-provided) and use transfer learning or Bayesian methods to build an initial model. Set up a plan to collect new data quickly and update the model iteratively.

2. Model Validation and Monitoring

Deploy the model with shadow mode or A/B testing to compare predictions against actual outcomes. Implement monitoring for key metrics like late penalties and model drift.

3. Investigate Discrepancy

If vendor A appears cheaper but late penalties increase, first verify data quality and pipeline integrity. Then check if the model accounts for all cost components, including penalties, and whether the penalty structure is correctly modeled.

4. Root Cause Analysis

Analyze production data to identify patterns: Are penalties increasing due to vendor performance, changes in business rules, or external factors? Compare model assumptions with reality and consider retraining with updated data.

5. Iterate and Communicate

Update the model with new insights, communicate findings to stakeholders, and establish a feedback loop for continuous improvement. Consider if the cost model needs to include dynamic penalty factors.

Key Points to Mention

  • Use of transfer learning or Bayesian methods for cold start
  • Importance of data quality checks and pipeline validation
  • Inclusion of all cost components (e.g., late penalties) in the model
  • Monitoring for model drift and setting up alerts
  • Collaboration with operations and business stakeholders
  • Iterative model improvement and feedback loops

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.