KatInterview

Ranking Pipelines for Location Suggestions and Push Alerts

Machine LearningModel answer
HardModel answerMachine Learningml-system-designrecommender-systemsranking

Last updated

Design two ML ranking systems: one that suggests nearby places to a moving mobile user, and one that decides which push notifications to send, order, or suppress.

Answer both of the following design prompts as you would in a whole-system ML design discussion. For each one, state your assumptions, sketch the architecture, and justify the trade-offs.

Prompt A: Suggesting places near a mobile user

A smartphone app should suggest relevant places (restaurants, shops, points of interest) around the user. The user's position can change while the app is open, so the suggestions must follow them.

Cover:

  • Problem definition and the success objective
  • Candidate generation and ranking
  • Features and training data (labels, biases)
  • Online serving, latency budget, and data freshness
  • Cold start for new places, users, and regions
  • How to handle a user who is moving
  • Offline and online evaluation

Prompt B: Ranking push notifications from many sources

Several producers (product announcements, friend activity, advertiser messages) emit candidate notifications for each user. The system must decide which are eligible, which should go out and in what order, and which should be suppressed.

Cover:

  • The objective function and how it accounts for long-term harm
  • Eligibility rules
  • De-duplication and aggregation
  • User fatigue and send budgets
  • Multi-objective ranking, model design, and training labels
  • Serving architecture
  • Evaluation

State any scale numbers you assume (users, QPS, latency targets).

Hints

Hint 1

Start by turning each product goal into a measurable objective. Raw clicks or opens are easy to game and can hurt users in the long run, so think about downstream actions and negative signals.

Hint 2

For the moving-user case, think about what should be predicted (future position, not just current), when a refresh is worth its cost, and how to keep the visible list from jumping around.

Hint 3

For notifications, separate cheap deterministic gates (consent, quiet hours, TTL, caps) from the learned model, and score the incremental value of sending versus not sending, with a penalty for dismissals and opt-outs.