Build and Defend a Baseline Model from a CSV
Company: Microsoft
Role: Data Scientist
Category: Machine Learning
Difficulty: medium
Interview Round: Onsite
You receive a CSV during a live interview and are asked to build a useful predictive model. You may use code-completion or agent tools, but you must decide what to ask, what to trust, and how the model could move from a local prototype into production. Walk through your approach from opening the file to making a deployment recommendation.
### Constraints & Assumptions
- The business objective, target column, and prediction-time data availability are not fully specified at the start.
- You have a local Python environment with pandas and a standard machine-learning library.
- The interview rewards a defensible workflow and sound judgment more than an elaborate model.
- Any AI-generated code must be inspected and validated before use.
### Clarifying Questions to Ask
- What decision will the prediction support, and what is the unit of analysis?
- Which column is the target, when is it observed, and which features exist at prediction time?
- What error costs matter, and how should success be measured offline and after launch?
- Are observations independent, time ordered, or grouped by users, accounts, or another entity?
- What latency, interpretability, privacy, and retraining constraints apply?
### What a Strong Answer Covers
- A fast data audit covering schema, missingness, duplicates, target prevalence, suspicious identifiers, leakage, and temporal or group structure.
- A split strategy aligned with deployment, followed by a simple baseline and a metric tied to the business decision.
- A reproducible preprocessing-and-model pipeline, targeted error analysis, and comparison against a naive benchmark.
- Explicit verification of AI-generated code, including tests for joins, feature timing, shapes, and metric calculations.
- A practical production path covering feature parity, versioning, monitoring, rollback, and retraining triggers.
- Clear communication of uncertainty, limitations, and what additional evidence is needed before launch.
### Follow-up Questions
1. What would make a random train-test split invalid for this dataset?
2. How would you detect target leakage introduced by an AI-generated feature pipeline?
3. Which monitoring signals would distinguish data drift from a broken data pipeline?
4. If the complex model barely beats the baseline, which model would you recommend and why?
Quick Answer: Practice an end-to-end data science modeling case using a CSV, from defining the target and preventing leakage to choosing a validation split and baseline. The solution also covers checking AI-generated code and planning deployment, monitoring, rollback, and retraining.