Bucketizing Time Since Last Visit for a Notification Model

Last updated: November 29, 2026

Quick Overview

A model decides whether to send a Facebook notification and uses hours since the user's last visit as a feature. Explain why the relationship is non-linear and how bucketizing the feature helps a linear or deep model.

Meta
Machine Learning
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Phone Screen
Machine Learning
Easy

0

0

0 solved


A model decides whether to send a Facebook notification and uses hours since the user's last visit as a feature. Explain why the relationship is non-linear and how bucketizing the feature helps a linear or deep model.

Recency features have strong non-monotonic effects in Meta engagement models. The interviewer checks that you recognize when a raw numeric feature cannot express the true shape, and how to choose bucket boundaries.

What the Interviewer Expects
  • Explain a non-monotonic effect a single weight cannot capture
  • Propose log-spaced or quantile bucket boundaries
  • Use one-hot or embedding per bucket
  • Discuss trade-offs of bucket count
  • Mention that trees learn thresholds natively
Key Topics to Cover
Bucketization
Non-linear features
Quantile bins
Notifications
Recency
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you pick the number of buckets?
  • What happens at serving time for a value beyond the last boundary?
  • Would you add both the bucketed and raw feature?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

I would ask the range of the feature (minutes to months), the model family, and what the label is (notification opened, or the user returns within a day)....

Approach

The likely shape: users who visited minutes ago do not need a nudge, users away a day or two respond best, and users gone for months rarely respond. That is an inverted U, so a single linear weight on...


Submit Your Answer
Markdown supported