KatInterview

Learning a Collaboration Closeness Score for Coworker Pairs

Machine LearningModel answer
MediumModel answerMachine Learningml-system-designgraph-learningembeddings

Last updated

Design an ML system that scores how closely any two employees in an organization collaborate, covering signals, proxy labels, training, evaluation, privacy and serving.

You are building a collaboration closeness score d(a, b) for any two people in a company. A lower value means the two people work together more closely. No labeled "ground truth" for working closeness exists, so you must define the target yourself.

Walk through an end-to-end design as you would in an hour-long ML design discussion. Cover:

  1. Framing. Which product consumes the score (for example search ranking, people suggestions, or finding experts)? What does "closeness" mean precisely? Does the consumer need a true metric (symmetric, triangle inequality), or is a ranking score enough?
  2. Signals. Which data sources can you use (org chart, calendar metadata, document co-editing, comments and mentions, chat or email metadata)? How do you normalize them, and what privacy or permission limits apply?
  3. Modeling. Describe a simple graph-based baseline and a learned model. What proxy labels do you train on, and how do you split data in time to avoid leakage?
  4. Evaluation. How do you judge quality offline and online when real labels do not exist?
  5. Serving. How do you provide a score for every pair of employees without precomputing all N^2 distances? How do you handle new hires?
  6. Operations. How do you monitor drift and reorganizations?

State your assumptions about company size and freshness requirements up front.

Hints

Hint 1

Start by choosing a consumer. A score for ranking search results can be a loose, asymmetric-tolerant ranking function, while a score used for clustering teams may need metric properties.

Hint 2

Treat the problem as link prediction on a weighted interaction graph: hold out the most recent window of collaboration and check whether the score predicts who collaborates there. Remember to normalize edge weights so that a 200-person all-hands counts far less than a two-person review.

Hint 3

You do not need N^2 distances. Learn a low-dimensional embedding per person and compute distances on demand, using approximate nearest neighbors for top-k queries; for new hires, initialize from org-chart and team neighbors.