Ranking Property Listings When There Is No Search Query
Machine LearningModel answerLast updated
Design an ML ranking system for a short-term rental platform where candidates are pre-filtered and there is no free-text query to match against.
Ranking Property Listings When There Is No Search Query
You are building a ranking model for a property rental platform. A user opens the search page, sets filters (location, dates, party size, price range), and the system returns a pre-filtered set of eligible listings. Your job is to rank that candidate set — not to generate it, not to filter it further, and not to match against listing descriptions with a query embedding, because there is no free-text query.
The ranked list drives a significant share of bookings, so both the quality of the ranking and the integrity of the evaluation matter.
What you can assume
- An upstream retrieval and availability system has already produced the eligible candidate set. Assume availability can still change between ranking and booking.
- Contextual signals such as dates, party size, location, selected filters, and session-level behavior are available at serving time.
- User history (past searches, views, bookings) is available subject to standard privacy constraints.
- Listing attributes (price, property type, amenities, photos, host metrics, review statistics) are available.
- There is no predefined traffic or latency budget — state your assumptions.
Clarifying questions worth raising
- Is the primary conversion event a completed booking, a meaningful engagement (e.g. contact or checkout start), or a trip-level outcome like a five-star stay?
- Are candidates guaranteed to satisfy hard constraints at the time of ranking, and how stale can that guarantee become?
- How much history exists for newly listed properties and first-time users?
- Are there business rules — host contracts, promoted listings, diversity requirements — that must be respected independently of the ranker score?
Part 1 — Training data and features
Describe how you would construct training examples and labels from logged data. Cover:
- What constitutes a positive and a negative example, and what label you would use.
- How position bias and exposure bias affect your labels and what you would do about it.
- Which features you would include for the listing, the user, the context, and cross-signal interactions — and how you would handle entities with little or no history.
Part 2 — Model architecture and serving
Propose a baseline and a stronger production model. Describe the full online scoring path. Cover:
- Why your chosen objective aligns with the product goal, not just a proxy metric.
- How features are fetched, how missing values are handled, and what the fallback ranking is if the model fails.
- How the ranker score interacts with hard eligibility rules and business constraints.
Part 3 — Offline and online evaluation, and regression debugging
Explain how you would evaluate the ranker before launch and after a live regression. Cover:
- Which offline ranking metrics you would use and why, and how you would construct the evaluation set to avoid leakage.
- What guardrails you would put on an A/B test to prevent a click-rate gain from hiding a booking or quality regression.
- How you would diagnose a sudden drop in a key metric after a model update — walk through the likely causes systematically.
Hints
Hint 1
Start by pinning down the product objective before touching labels or features. A ranker optimized for clicks and one optimized for completed bookings can have opposite effects on long-term revenue and guest satisfaction — make that trade-off explicit early.
Hint 2
Position bias is the central data problem here. Listings shown at rank 1 are clicked far more than rank 10 regardless of quality. If you ignore this, your model learns to perpetuate the current ranking rather than improve it. Think about how inverse propensity weighting or a two-tower with position as a feature addresses this.
Hint 3
Cold start hits two entities at once — new listings have no booking history and new users have no preference history. Treat them as separate problems: for listings, fall back to content features and host-level aggregates; for users, lean on session context and population-level priors. Spell out the feature fallback chain explicitly.
Model answer
Hard Try it yourself first — then compare your approach, complexity and edge cases.
What a Strong Answer Covers
A complete answer connects data construction through model architecture through serving through evaluation. Listing features or naming a model without explaining the training setup or the debugging approach is the most common way candidates lose points on this question.
Part 1 — Training data and features
Labels
The right label depends on the product objective, which must be stated before anything else. Options in increasing quality:
- Click — high volume, very noisy; clicks are heavily position-driven and do not reflect intent well.
- Checkout start or contact — a stronger signal that filters casual browsing.
- Completed booking — the cleanest proxy for value, but sparse and delayed by days.
- Trip outcome — a review score or re-book rate; extremely sparse, weeks of delay, but most aligned with platform health.
A practical choice is to use booking as the primary label with checkout start as an auxiliary label in a multi-task setup, capturing both volume and quality.
Training examples and negatives
Each training example is one (user-session, listing, context) triple. Positives are impressions that resulted in the target outcome. Negatives are impressions in the same session that did not. Hard negatives — listings ranked highly that were not booked — are more informative than random negatives from inventory, but require care: a listing that was not booked may simply have been unavailable or outside budget, not genuinely less relevant.
Critical: join labels at the time of impression, not at query time. A listing's price or availability at booking time may differ from what was shown. Using future-state features is a form of leakage.
Position bias and exposure bias
Logged data is biased by the current ranker. Position 1 receives far more clicks than position 8, independent of listing quality. Two standard approaches:
- Inverse propensity weighting (IPW): weight each training example by the inverse of its estimated position propensity. Propensities can be estimated with a small randomization experiment or with a separate propensity model.
- Position as a feature at training, excluded at inference: the model learns to separate positional effects from listing quality. At serving time, position is set to a neutral value so the score reflects quality alone.
Without one of these, the model amplifies whatever biases exist in today's ranking.
Features
| Category | Examples |
|---|---|
| Listing | Price, price relative to market median for that search, property type, bedrooms/bathrooms, amenity flags, review count, average rating, response rate, cancellation policy, photo quality score, recency of last booking |
| Host | Host tenure, overall rating, Superhost status, acceptance rate |
| User | Historical booking rate, preferred property types, typical price range, trip frequency, account age |
| Context | Destination, check-in/check-out dates, lead time, party size, number of filters applied, device type, session duration so far |
| Cross-signals | Difference between listing price and user's historical booking price, match between party size and listing capacity, whether the user has viewed this listing before |
Cold start fallback chain:
- New listing with no bookings → use host-level aggregates, then property-type population priors.
- New user with no history → use session context (filters set, time spent) plus geographic population priors.
- Missing feature at serving time → use feature-level defaults derived from the training distribution, never silently zero-fill continuous features.
Part 2 — Model and serving
Baseline
A gradient-boosted tree (GBT, e.g. LightGBM) with pointwise or pairwise loss is a strong baseline. It handles mixed feature types, missing values natively, is interpretable, and trains quickly. Start here before adding complexity.
Stronger model
A two-tower neural network with a learning-to-rank loss (ListNet or LambdaRank) captures higher-order feature interactions and scales to large embedding vocabularies. The user tower encodes user and session signals; the listing tower encodes listing and host features; a cross-attention layer or feature interaction block combines them. This also enables approximate nearest-neighbor retrieval if the candidate set later needs to be generated rather than pre-filtered.
Objective alignment
If the product goal is revenue and repeat usage, optimize for booking probability, not click-through rate. A click lift in an A/B test that comes with a booking drop or a quality score drop should not ship.
Serving path
- Candidate set arrives from the upstream retrieval system (assume ≤ 500 listings per request at P99).
- Feature store lookup: real-time context features from the request, near-real-time listing features from a feature store updated on a 15-minute cadence, user profile features from a slower daily job.
- Model scoring: all candidates scored in a single batched forward pass. Target latency ≤ 100ms at P95 including feature fetch.
- Business constraint layer (applied after scoring, not inside the model): inject promoted listings at capped positions, enforce diversity rules (e.g. no more than N listings from the same host in the top 10), apply hard eligibility re-checks.
- Fallback: if the model service is unavailable, serve by a heuristic score (booking rate × recency decay) computed offline.
The constraint layer must be separate from the ranker. Folding business rules into the model objective makes debugging and rule changes expensive.
Part 3 — Evaluation and debugging
Offline evaluation
- Split data by time, not randomly. Train on months 1–9, evaluate on months 10–12. Random splits leak future information into training.
- Primary metric: NDCG@10 (captures both rank position and graded relevance) with booking as the relevance signal.
- Secondary: MRR for the first booking click, coverage of cold-start listings in the top-K.
- Slice evaluation is mandatory: cold-start users, cold-start listings, high-lead-time trips, and multi-night stays often behave very differently from the average.
Online evaluation (A/B test)
- Primary guardrails: booking rate, revenue per search, host acceptance rate. A test that cannot improve at least one of these should not ship.
- Permitted proxy metrics: click-through rate and checkout start rate as leading indicators only.
- Rejection criteria: a statistically significant click increase paired with a flat or negative booking rate almost certainly means the model learned to surface attractive but hard-to-book listings. Reject it.
- Run the experiment for at least two full booking cycle lengths (bookings typically arrive days to weeks after the search session) before concluding.
Debugging a post-launch regression
Approach this as a structured elimination, not a guess:
- Feature skew: compare feature distributions between training data and live serving logs. A common failure is a feature computed differently in the training pipeline versus the serving pipeline.
- Candidate set change: did the upstream retrieval system change its filters or coverage? The ranker may be scoring a different distribution of candidates than it was trained on.
- Label delay: if evaluation metrics depend on bookings and the attribution window was shortened, measured conversion will drop artificially.
- Exposure feedback loop: a new model may have shifted ranking enough that position-biased feedback now reinforces a different set of listings, degrading quality over time.
- Slice-level regression: aggregate metrics can hide a collapse on a specific slice (e.g., mobile users, a specific city, new listings). Always break down the metric before concluding the cause is global.
The most common mistake candidates make in this section is jumping straight to "the model overfit" without checking data pipeline issues first. In practice, pipeline bugs cause the majority of production regressions.