Engineer Query-Document Features for a Search Learning-to-Rank Model

Last updated: November 29, 2026

Quick Overview

You are building the feature set for a learning-to-rank model that orders web results for Google Search queries. Describe the main feature groups you would engineer, how you would compute them efficiently, and how you would guard against features that hurt generalization.

Google
Machine Learning
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


You are building the feature set for a learning-to-rank model that orders web results for Google Search queries. Describe the main feature groups you would engineer, how you would compute them efficiently, and how you would guard against features that hurt generalization.

Search ranking at Google combines hundreds of signals, and strong candidates think about features in families: query-only, document-only, and query-document interactions. The interviewer checks breadth, depth on a few key signals, and judgment about leakage, feedback loops, and cost.

What the Interviewer Expects
  • Organizes features into query, document, and query-document interaction groups
  • Explains lexical match features such as BM25 by field and proximity
  • Includes semantic similarity, quality, freshness, and behavioral features
  • Normalizes features within the candidate list for each query
  • Addresses click-feature leakage, position bias, feedback loops, and serving cost
Key Topics to Cover
learning to rank
BM25
query-document features
behavioral signals
feature normalization
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you compute click-through features for a brand new page?
  • Which features would you drop first if latency were cut in half?
  • How do you make sure the model generalizes to long-tail queries never seen before?
  • How would you detect spam pages gaming a lexical feature?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask how many candidates reach this ranking stage (say 1,000 from retrieval), the latency budget per query, what labels are used (rater grades, clicks, or both), and what precomputed document signals e...

Approach

Organize the feature space into families so coverage is deliberate:

  1. Query-only: length, query class (navigational, local, news), language, head versus tail frequency.
  2. Document-only: lin...

Submit Your Answer
Markdown supported