Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Segment Shoppers and Predict Purchases

Easy
Machine LearningUnsupervised LearningFeature EngineeringSupervised LearningAsked 1 times

Problem

Business Context

ShopNow, an e-commerce marketplace with 2M monthly users, wants to improve marketing efficiency. The growth team needs both a supervised model to predict whether a user will purchase in the next 7 days and an unsupervised model to discover customer segments for campaign targeting.

Dataset

You are given a user-level dataset built from the last 12 months of web and app activity.

Feature GroupCountExamples
Behavioral metrics12sessions_last_7d, avg_session_duration, pages_viewed, cart_add_rate
Transaction history8orders_last_90d, avg_order_value, refund_rate, days_since_last_purchase
Marketing engagement6email_open_rate, push_click_rate, coupon_redemptions
Customer profile7country, device_type, acquisition_channel, loyalty_tier
Derived temporal features5weekend_activity_ratio, evening_session_share, recency_score
  • Size: 240K users, 38 features
  • Target for supervised task: purchased_next_7d (1 if user purchases in the next 7 days, else 0)
  • Class balance: 18% positive, 82% negative
  • Missing data: ~10% missing in marketing engagement fields, ~4% missing in profile fields for guest users

Success Criteria

  • Build a supervised model with ROC-AUC >= 0.82 and F1 >= 0.55 on the holdout set.
  • Produce an unsupervised segmentation with 3-8 actionable clusters and silhouette score >= 0.20.
  • Clearly explain when supervised learning is appropriate versus when unsupervised learning is appropriate for this dataset.

Constraints

  • Predictions must run in a daily batch job over 240K users in under 10 minutes.
  • Marketing stakeholders need interpretable outputs: top purchase drivers and human-readable segment profiles.
  • Retraining budget is limited to weekly runs on a single standard CPU machine.

Deliverables

  1. Train and evaluate one supervised model for purchase prediction.
  2. Train and evaluate one unsupervised model for customer segmentation.
  3. Compare supervised vs. unsupervised learning in the context of this dataset and business goal.
  4. Describe preprocessing, feature engineering, and validation strategy.
  5. Recommend how both outputs would be used together in production marketing workflows.

You are practicing as a guest. Sign up free to get your answer graded with AI feedback. Your draft stays right here.

Sign up freeI have an account
Sign up to unlock solutions
Midwest Employers Casualty Data Scientist Interview QuestionsMidwest Employers Casualty Interview Questions
Next questions
Tiger AnalyticsSegment and Predict Retail CustomersEasySegment and Predict Retail Customer BehaviorEasyCluster Retail Shoppers for PersonalizationEasy
0 / ~200 words