You run search ranking for a large travel marketplace. Your ranking model scores each listing independently and fills result positions top-to-bottom with the highest-scoring listings. Product intuition and business data both suggest the results are too homogeneous — guests with minority preferences (e.g., those who favor quality over price) are poorly served, and the overall mix of bookings skews heavily toward one segment.
Your task: redesign the ranking pipeline so that the full result page — not just the top listing — better serves the diversity of guest preferences, while protecting overall booking volume. Walk me through how you would train the diversity signal and how you would use it at serving time.
Practice against the follow-up probes
- Before building anything, how do you confirm that the current results are actually too similar and that this similarity is causing worse outcomes — not just correlated with them?
- Your training signal comes from guests who skipped the top result and booked something lower. What selection bias does that introduce, and how does it affect what the model learns?
- At serving time, you discount each candidate's score by its similarity to already-placed results. What's the failure mode if that similarity discount is calibrated poorly — too high or too low?
- How do you tune the trade-off between relevance and diversity without running a separate experiment for every possible weight?
- Diversity gains might erode over time as the model's own outputs become training data. How do you detect and prevent that feedback loop?
Show answer guide
What the interviewer is probing
This question probes whether the candidate can separate the pointwise scoring problem from the set-selection problem and recognize that the two require different model architectures and different training regimes. Strong candidates must reason carefully about the selection bias baked into the training construction (skipped-then-booked implies dissimilarity, but only among a filtered population), the serving-time greedy sequential algorithm and its failure modes, and how to measure diversity outcomes without letting the diversity objective silently cannibalize relevance. The calibration and feedback-loop probes test decision quality and long-term system thinking.
Strong answer outline
- Problem framing: Pointwise ranking maximizes expected booking probability per position independently; it implicitly assumes preferences are homogeneous and stationary. The real objective is maximizing utility of the set of results, which requires modeling inter-item relationships. This is a set-selection or submodular optimization problem.
- Diversity signal — training data construction: Use logged sessions where a guest skipped the top result and booked from a lower position. The antecedent (top) listing represents what was passed over; the booked listing further down is the positive, and other skipped lower listings are negatives. The signal being taught: given that a guest rejected the antecedent, the booked listing was preferable in part because it was different. Selection bias to name: this population is not random — it excludes guests who booked the top result (majority), so the similarity model learns the preferences of the minority who wanted something different. That's actually desirable, but the candidate should state it explicitly.
- Similarity model architecture: A pairwise neural network that takes (candidate listing, antecedent listing) and predicts a similarity score. Features: price bucket delta, listing type, location cluster, amenity overlap, bedroom count delta, photo style embeddings. Train by minimizing a ranking loss where the booked listing has (raw score − similarity to antecedent) > (not-booked score − similarity to antecedent).
- Serving-time algorithm: Sequential greedy selection — position 1 gets highest raw relevance score; each subsequent position selects argmax over remaining candidates of (relevance score − λ × similarity to all already-placed listings). λ is a tunable hyperparameter controlling the diversity–relevance trade-off.
- Calibration of λ: Don't tune per-experiment. Instead, treat λ as a business-level dial: fix it via offline simulation on held-out sessions, measuring distributional coverage of price tiers, listing types, and location clusters in results vs. in actual bookings. A/B test a small set of λ values; prefer the one that lifts booking value and quality metrics without degrading total bookings.
- Metrics: Primary — uncancelled bookings (volume guardrail); secondary — booking value (proxy for quality mix shifting upward), 5-star review rate. Diversity diagnostic — distributional spread of booked price tier, listing type, location cluster across sessions in treatment vs. control. Don't let booking value become the optimization target directly.
- Failure modes to name:
- λ too high: high-relevance listings get suppressed; overall booking rate drops.
- λ too low: no diversity effect; system degenerates to original pointwise ranker.
- Feedback loop: if ranked outputs become training data, the model learns to reward diversity for its own sake, not because it reflects guest preference. Mitigate with a held-out logging policy (pure relevance ranker on a small traffic slice) to keep unbiased training data.
- Greedy algorithm is not globally optimal for the set; for longer result pages, beam search or learned sequential policies are worth exploring at higher complexity.
- Common wrong turns: Trying to inject diversity as a post-processing heuristic (e.g., rule-based price-tier quotas) rather than learning it from data; optimizing booking value as the primary metric rather than as a diagnostic.
The underlying concept
Standard pointwise and pairwise learning-to-rank models assign scores to items independently, which means the result set they produce is implicitly optimized for the modal guest preference — the majority principle. When the guest population is heterogeneous (a Pareto-distributed preference spread), the optimal set of results is one that covers the distribution, not one that packs the top preference into every slot. This is the core idea behind submodular set-selection and Maximal Marginal Relevance (MMR): each new item's marginal value is its relevance minus its redundancy with already-selected items. The key machine-learning insight is that the redundancy signal itself must be learned from behavior — specifically from sessions where guests reveal by their choices that they wanted something different from what was shown first — rather than engineered from feature overlap rules.
Source
Derived from Learning to rank diversely