Design Short-Term and Long-Term User Churn Prediction for LinkedIn

Quick Overview

Design a machine learning system that predicts short-term (next one to two days) and long-term inactivity for LinkedIn users. It tests label definition, point-in-time features, handling weekends and holidays, modeling two horizons, offline and online evaluation, and scaling inference to every user.

Design Short-Term and Long-Term User Churn Prediction for LinkedIn

Company: LinkedIn

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Technical Screen

Design a machine learning system that predicts churn for LinkedIn users. Using each user's historical behavior up to the moment of prediction, estimate two probabilities: - **Short-term churn:** the user is inactive over the next 1–2 days. - **Long-term churn:** the user is inactive over a longer future period. During the round the interviewer specifically asked whether holidays and weekends should be taken into account. The discussion is expected to cover the features in depth, then how to evaluate the model (offline and online metrics) and how to scale model inference. Pace yourself so that every stage gets time; spending most of the round on features leaves evaluation and serving rushed. ### Clarifying Questions - What counts as "active": any visit, or meaningful actions such as viewing the feed, messaging, posting or applying to jobs? - How long is the long-term window, for example 30 days? - What will the scores drive (re-engagement notifications, emails, product analytics), and how often are they needed: a daily batch for everyone, or on demand? - Which users are in scope? Are users who are already dormant, or who signed up yesterday, included? - Are there privacy restrictions on which behavioral or profile data may be used? ### Part 1 — Frame the problem and define the labels Turn the two churn notions into precise prediction targets and training examples. ```hint Pin the label in time For one user and one prediction date, write down exactly which days define the label and which data may be used as input. ``` #### What This Part Should Cover - A precise activity definition and the two label windows - How training examples are generated over time without leakage - The population being scored and the base rates to expect ### Part 2 — Features, including weekends and holidays Propose the features, then answer the interviewer's question: should holidays and weekends be taken into account, and how? ```hint A quiet Saturday Consider a user who never logs in on weekends, scored on a Friday evening for the next two days. What does the label say, and is that churn? ``` #### What This Part Should Cover - Feature groups over engagement history, trends, network and lifecycle, computed as of the prediction time - How calendar effects enter the features, the labels, or both, including local time zones and regional holidays - Which features matter more for the short horizon than for the long one ### Part 3 — Model and training Choose the model or models for the two horizons and describe training. ```hint What the horizons share Think about what the two horizons have in common, and how their predictions for the same user should relate, before deciding on separate or joint models. ``` #### What This Part Should Cover - A baseline and a main model, and whether to use one model or two - Class imbalance, calibration, and retraining cadence given label delay - A validation split that respects time ### Part 4 — Evaluation and scaling inference Describe the offline and online metrics and how inference scales to every user. ```hint Measure the decision Ask what decision the score feeds, and how you would tell whether acting on it changed anything. ``` #### What This Part Should Cover - Offline metrics and the slices to inspect - Online evaluation through the action the score drives, with guardrails - Batch versus real-time scoring, scaling, and monitoring ### What a Strong Answer Covers - Precise labels and point-in-time correct training data for both horizons - A reasoned answer on weekends and holidays rather than a bare yes or no - Relevant, well-organized features and a sensible model choice with calibrated outputs - Offline metrics suited to imbalance, and online evaluation tied to the intervention - A scalable, monitored serving design - Good pacing across framing, features, evaluation and serving ### Follow-up Questions - The short-term model is accurate in ordinary weeks but noisy around long holiday weekends. How do you diagnose and fix it? - The product team wants to send re-engagement notifications to the highest-risk users. Why might churn probability be the wrong targeting score, and what would you model instead? - How would you score brand-new users who have almost no history? - A product change alters what counts as activity. How would you detect and handle the effect on the model?

Overview: Design a machine learning system that predicts short-term (next one to two days) and long-term inactivity for LinkedIn users. It tests label definition, point-in-time features, handling weekends and holidays, modeling two horizons, offline and online evaluation, and scaling inference to every user.

Read the full LinkedIn Machine Learning Engineer interview experience this question came from

LinkedIn logo
LinkedIn
Nov 17, 2026
mediumMachine Learning EngineerTechnical ScreenML System Design
0
0

Design a machine learning system that predicts churn for LinkedIn users. Using each user's historical behavior up to the moment of prediction, estimate two probabilities:

  • Short-term churn: the user is inactive over the next 1–2 days.
  • Long-term churn: the user is inactive over a longer future period.

During the round the interviewer specifically asked whether holidays and weekends should be taken into account. The discussion is expected to cover the features in depth, then how to evaluate the model (offline and online metrics) and how to scale model inference. Pace yourself so that every stage gets time; spending most of the round on features leaves evaluation and serving rushed.

Clarifying Questions Guidance

  • What counts as "active": any visit, or meaningful actions such as viewing the feed, messaging, posting or applying to jobs?
  • How long is the long-term window, for example 30 days?
  • What will the scores drive (re-engagement notifications, emails, product analytics), and how often are they needed: a daily batch for everyone, or on demand?
  • Which users are in scope? Are users who are already dormant, or who signed up yesterday, included?
  • Are there privacy restrictions on which behavioral or profile data may be used?

Part 1 — Frame the problem and define the labels

Turn the two churn notions into precise prediction targets and training examples.

What This Part Should Cover Guidance

  • A precise activity definition and the two label windows
  • How training examples are generated over time without leakage
  • The population being scored and the base rates to expect

Part 2 — Features, including weekends and holidays

Propose the features, then answer the interviewer's question: should holidays and weekends be taken into account, and how?

What This Part Should Cover Guidance

  • Feature groups over engagement history, trends, network and lifecycle, computed as of the prediction time
  • How calendar effects enter the features, the labels, or both, including local time zones and regional holidays
  • Which features matter more for the short horizon than for the long one

Part 3 — Model and training

Choose the model or models for the two horizons and describe training.

What This Part Should Cover Guidance

  • A baseline and a main model, and whether to use one model or two
  • Class imbalance, calibration, and retraining cadence given label delay
  • A validation split that respects time

Part 4 — Evaluation and scaling inference

Describe the offline and online metrics and how inference scales to every user.

What This Part Should Cover Guidance

  • Offline metrics and the slices to inspect
  • Online evaluation through the action the score drives, with guardrails
  • Batch versus real-time scoring, scaling, and monitoring

What a Strong Answer Covers Guidance

  • Precise labels and point-in-time correct training data for both horizons
  • A reasoned answer on weekends and holidays rather than a bare yes or no
  • Relevant, well-organized features and a sensible model choice with calibrated outputs
  • Offline metrics suited to imbalance, and online evaluation tied to the intervention
  • A scalable, monitored serving design
  • Good pacing across framing, features, evaluation and serving

Follow-up Questions Guidance

  • The short-term model is accurate in ordinary weeks but noisy around long holiday weekends. How do you diagnose and fix it?
  • The product team wants to send re-engagement notifications to the highest-risk users. Why might churn probability be the wrong targeting score, and what would you model instead?
  • How would you score brand-new users who have almost no history?
  • A product change alters what counts as activity. How would you detect and handle the effect on the model?