PracHub
QuestionsLearningGuidesInterview Prep
|Home/Machine Learning/Hackerrank

Build A Purchase-Intent Prediction Notebook

Last updated: Jul 8, 2026

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.

  • medium
  • Hackerrank
  • Machine Learning
  • Machine Learning Engineer

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.

|Home/Machine Learning/Hackerrank

Build A Purchase-Intent Prediction Notebook

Hackerrank logo
Hackerrank
Apr 23, 2026, 12:00 AM
mediumMachine Learning EngineerTake-home ProjectMachine Learning
2
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...

Browse More Questions

More Machine Learning•More Hackerrank•More Machine Learning Engineer•Hackerrank Machine Learning Engineer•Hackerrank Machine Learning•Machine Learning Engineer Machine Learning

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.