Build A Purchase-Intent Prediction Notebook

Quick Overview

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.

Build A Purchase-Intent Prediction Notebook

Company: HackerRank

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Online Assessment

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?

Overview: 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.

|Home/Machine Learning/HackerRank
HackerRank logo
HackerRank
Apr 23, 2026
mediumMachine Learning EngineerOnline AssessmentMachine Learning
3
0

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.

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 Guidance

  • 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

Follow-up Questions Guidance

  • 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?
Loading comments...