Build A Purchase-Intent Prediction Notebook
Company: Hackerrank
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Take-home Project
Build a machine learning notebook that predicts whether a user session will lead to a purchase. The training and test CSV files contain page counts, time spent, exit and dropoff rates, engagement score, promotion indicator, encoded user device and traffic fields, holiday flag, and the target `outcome`. The deliverables are a documented notebook and `submissions.csv` with `id` and binary `outcome` predictions. The evaluation metric is weighted F1.
```hint Hint 1
Start by naming the core entities, constraints, and success criteria.
```
```hint Hint 2
Make the trade-offs explicit before going deep on implementation details.
```
### Constraints & Assumptions
- The target is binary.
- The test set has no target labels.
- Some fields may contain bugs or unwanted values.
- Columns with more than 50 percent missing values or constant values should be dropped.
- The notebook may use one or more models.
### Clarifying Questions to Ask
- What counts as an unwanted value for each field?
- Is class imbalance severe?
- Should categorical integer fields be treated as categories or ordinal numbers?
- Is model interpretability required?
- What validation split should match the hidden evaluation?
### What a Strong Answer Covers
```premium-lock What a Strong Answer Covers
```
### Follow-up Questions
- How would you handle class imbalance?
- How would you avoid leakage during preprocessing?
- What baseline model would you start with?
- How would you debug a low F1 score?
Quick Answer: Prepare for a machine learning take-home notebook that predicts purchase intent from session features and submits binary outcomes. The prompt focuses on data cleaning, missing values, categorical encoding, model pipelines, weighted F1, threshold tuning, and robust submissions.