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.
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
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- 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 PrepSample 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:
- Query-only: length, query class (navigational, local, news), language, head versus tail frequency.
- Document-only: lin...