KatInterview

Month-by-Month Employee Departure Forecasting System

Machine LearningModel answer
HardModel answerMachine Learningsurvival-analysishazard-modelingfeature-engineering

Last updated

Design an end-to-end ML system that estimates, for each active user, the probability of leaving their current employer in each of the next K months.

Month-by-Month Employee Departure Forecasting System

A professional networking platform wants to predict whether each of its members will change employers within a rolling future window. The goal is a monthly hazard estimate per member — not just "will they ever leave" but "how likely are they to leave this month, next month, and each of the following K months."

You have access to:

  • Profile history (job titles, employers, start/end dates, skills, education)
  • On-platform behavioral signals (searches, logins, profile edits, messaging activity)
  • Network and company-level data (connections, employer headcount changes, peer activity)
  • Approximately 5 years of history across a large member base (assume ~200M members)

What you are expected to cover

Problem framing How do you formulate this as a time-to-event problem rather than a simple binary classification? What does "censoring" mean here and why does it matter?

Label construction How do you build a training dataset that correctly captures who is at risk, when, and whether the event happened? How do you handle members who never change jobs, members who change multiple times, and members whose profiles go stale?

Feature engineering What signals are most predictive? What transformations are necessary? How do you ensure every feature is a valid point-in-time snapshot?

Leakage prevention Enumerate the specific ways a naive pipeline would introduce data leakage in this problem. How do you prevent each one?

Model selection and training What model family fits the formulation? How do you handle the extreme class imbalance (monthly change rates are roughly 1–2%)?

Evaluation How do you measure model quality offline, given censoring? What baselines should you beat? What slice-level checks matter?

Fairness and deployment How do you audit for disparate impact? What does production scoring look like at scale?

There is no single correct implementation — the interviewer wants to see sound reasoning at each step and awareness of the trade-offs.

Hints

Hint 1

A simple binary classifier trained on 'did this person change jobs?' ignores *when* the event happened and discards partial information from members still in their current role. Think about what modeling framework naturally handles both events and censored observations — and how that framework decomposes into something a standard binary classifier can still solve.

Hint 2

The trickiest leakage in this problem is not the obvious future-target leak. It comes from two subtler sources: (1) behavioral signals that spike *after* a job change because people update their profile, add new-employer connections, and get endorsements — even though those signals appear timestamped before the reported start date; and (2) the last few months of training data where labels are not …

Hint 3

Your baseline should be a tenure-only model: the probability of leaving rises sharply around 12 and 24 months and spikes in January. This baseline is surprisingly competitive. Make sure your evaluation framework (time-dependent AUC, calibration plots, lift over the tenure baseline) can detect whether the complex model actually adds value over that simple one.