LIMITED TIME 🎁: Register now to get 60 minutes of AI Mock Interviewing for FREE!

Join
    Google Interview Insights
    Google logo
    Google·Machine Learning Engineer·Onsite - System Design / Architecture·Senior
    SeniorPrefer not to say
    Jul 2026
    7

    Summary

    Machine learning system design round at Google for an MLE role. The whole thing was one big open-ended design question about building a real-time recommendation system, and they expected you to drive the conversation across a lot of different dimensions.

    Questions Asked(7)

    System DesignTechnical Trade-offs
    A
    Author's notesFirst line only

    This was the entire interview, basically.

    Suggested Approach

    Begin by clarifying requirements and constraints (scale, latency budget, freshness needs), then architect the system in layers: offline model training, near-line feature computation, and online serving with pre-computed candidates. Explicitly discuss trade-offs at each layer to demonstrate engineering maturity rather than just listing components.

    Pro tip: Google interviewers reward candidates who proactively identify the tension between model complexity and serving latency — show you understand that a two-tower retrieval model with ANN search plus a lightweight ranking model is often superior to a single heavy model, and explain why.
    1

    Clarify Requirements & Define Constraints

    Pin down scale (DAU, QPS, catalog size), latency budget breakdown (retrieval vs. ranking), acceptable staleness of recommendations, and personalization depth. This signals structured thinking and prevents designing the wrong system.

    2

    Design the Offline Training Pipeline

    Describe batch model training using distributed frameworks (e.g., TensorFlow/JAX on TPUs), covering candidate generation models (two-tower, matrix factorization) and ranking models (gradient boosted trees or deep neural nets). Discuss feature engineering, training data pipelines, and model versioning.

    3

    Build the Near-Line Feature & Embedding Store

    Explain how user and item embeddings are pre-computed and stored in a low-latency vector store (e.g., ScaNN, Vertex AI Matching Engine) and how real-time user signals (clicks, dwell time) are streamed via Pub/Sub into a feature store (e.g., Redis, Bigtable) to keep context fresh without blocking serving.

    4

    Design the Online Serving Architecture

    Walk through the request path: ANN retrieval (~10ms) → lightweight re-ranking model (~20ms) → business logic filters → response, all within the 100ms P95 budget. Highlight the use of model quantization, request batching, and co-locating the serving binary with the feature store to minimize network hops.

    5

    Address Reliability, Monitoring & Iteration

    Discuss fallback strategies (popularity-based defaults if personalization fails), A/B testing infrastructure for model rollouts, and key metrics to monitor (CTR, NDCG, latency percentiles, feature freshness lag). Mention canary deployments and shadow scoring to safely ship model updates.

    Key Points to Mention

    Two-stage retrieval + ranking architecture: ANN-based candidate retrieval (two-tower model) followed by a more expensive pointwise or listwise ranking model to balance quality and latency
    Latency budget decomposition: explicitly allocate the 100ms across retrieval, feature fetch, ranking, and network overhead to show you reason about end-to-end latency holistically
    Approximate Nearest Neighbor (ANN) search: tools like ScaNN or FAISS with quantized embeddings to achieve sub-10ms retrieval over billions of items
    Real-time feature freshness vs. consistency trade-off: streaming pipelines (Pub/Sub + Dataflow) for session-level signals vs. batch pipelines for stable user history features
    Model serving optimizations: quantization (INT8), TensorRT/XLA compilation, request batching, and hardware accelerators (GPUs/TPUs) to meet strict latency SLAs at scale
    Feedback loops and training data quality: handling position bias, exposure bias, and delayed reward signals (e.g., watch time) when constructing training labels from logged user interactions
    System DesignData Modeling
    A
    Author's notesFirst line only

    This tripped me up more than it should have.

    Suggested Approach

    Frame your answer around the core training-serving skew problem, then systematically walk through architectural decisions that enforce consistency at the data, compute, and serving layers. Demonstrate awareness of both the technical tradeoffs (latency vs. consistency, batch vs. streaming) and operational concerns like monitoring and versioning that Google-scale systems demand.

    Pro tip: Mention point-in-time correctness (also called 'time travel' queries) explicitly — this is a subtle but critical concept that separates senior candidates from junior ones, as it prevents label leakage during training while ensuring the offline feature values match what would have been served online at that exact timestamp.
    1

    Define the Core Problem

    Articulate training-serving skew clearly: offline training uses historical batch data while online inference uses real-time data, and any divergence in feature computation logic or data distributions causes model degradation. Establish that the goal is a single source of truth for feature definitions and values.

    2

    Unified Feature Computation Layer

    Propose a shared feature transformation pipeline (e.g., using Apache Beam or Spark) that runs both in batch mode for offline training and in streaming mode for online serving, ensuring the same business logic is applied in both paths. Discuss using a feature registry to version and govern feature definitions centrally.

    3

    Dual Storage Architecture

    Design an offline store (e.g., BigQuery, Parquet on GCS) for historical feature retrieval during training and an online store (e.g., Bigtable, Redis) for low-latency serving during inference. Explain how writes to both stores are coordinated — typically via a materialization job — to keep them in sync.

    4

    Point-in-Time Correctness & Versioning

    Implement time-travel queries in the offline store so training datasets retrieve feature values as they existed at the label timestamp, preventing data leakage. Version features and models together so a deployed model always references the exact feature schema it was trained on.

    5

    Monitoring & Drift Detection

    Build observability into both stores by logging online feature distributions and comparing them against offline training distributions using statistical tests (e.g., KL divergence, PSI). Set up automated alerts for schema mismatches, null rate changes, or distribution drift to catch skew before it impacts model performance.

    Key Points to Mention

    Training-serving skew and its root causes (logic divergence, data pipeline differences, temporal leakage)
    Point-in-time correctness / time-travel queries to prevent label leakage during training dataset generation
    Unified transformation logic shared between batch and streaming pipelines (e.g., Apache Beam for portability)
    Feature registry for centralized versioning, lineage tracking, and governance of feature definitions
    Dual-store architecture: offline store for training (BigQuery/Parquet) and online store for serving (Bigtable/Redis) with coordinated materialization
    Continuous monitoring for feature drift, schema validation, and statistical distribution comparison between offline and online feature values
    System DesignTechnical Trade-offs
    A
    Author's notesFirst line only

    Felt okay here.

    Suggested Approach

    Frame your answer by clearly distinguishing the two cold start scenarios (new users vs. new items) and then systematically walk through both short-term fallback strategies and long-term learning mechanisms for each. Ground your discussion in real system constraints like latency, data sparsity, and exploration-exploitation trade-offs. Conclude by mentioning how you'd measure success and iterate on the solution.

    Pro tip: Interviewers at Google love when candidates acknowledge that cold start is not a one-time fix but an ongoing system design challenge — mention how you'd instrument the system to detect cold start degradation and set up feedback loops to accelerate warm-up, which signals production-level thinking.
    1

    Define the Problem Scope

    Clarify what 'cold start' means in the specific system context — new users with no interaction history and new items with no engagement signals. Briefly state why this is hard: collaborative filtering breaks down without historical data, and content-based signals alone are often insufficient.

    2

    New User Cold Start Strategies

    Discuss layered approaches: start with non-personalized popularity-based or trending recommendations, then leverage onboarding signals (explicit preferences, demographics, referral source) to bootstrap a user profile. Mention using transfer learning or cross-domain signals if available (e.g., Google account activity).

    3

    New Item Cold Start Strategies

    Explain how to represent new items using content-based features (text embeddings, metadata, category tags) to place them in the existing embedding space without interaction data. Discuss item-side exploration strategies like forced exposure, publisher-boosted slots, or bandit-based injection to rapidly collect feedback signals.

    4

    Exploration-Exploitation Trade-offs

    Introduce bandit algorithms (e.g., Thompson Sampling, UCB) as a principled way to balance showing new users/items to gather signal while minimizing user experience degradation. Highlight how the exploration budget can be tuned based on business constraints and confidence thresholds.

    5

    Measurement and Graduation Criteria

    Define how you'd know when a user or item has 'graduated' from cold start — e.g., a minimum number of interactions or a confidence threshold on embeddings. Describe the metrics you'd track: CTR lift, engagement rate for new items, and retention or satisfaction scores for new users.

    Key Points to Mention

    Content-based and metadata-driven feature representations as a fallback when collaborative signals are absent
    Onboarding flows and explicit preference elicitation to accelerate new user profiling
    Bandit algorithms (Thompson Sampling, UCB) for principled exploration of new users and items
    Hybrid models that blend collaborative filtering with content-based signals, weighted by data availability
    Embedding initialization strategies for new items — e.g., averaging similar item embeddings or using a side-information encoder
    Monitoring and feedback loops to detect cold start degradation and measure warm-up velocity
    System DesignTechnical Trade-offs
    A
    Author's notesFirst line only

    Talked through result-level caching for non-personalized surfaces, user embedding caching with short TTLs, and pre-computed candidate sets refreshed nearline.

    Suggested Approach

    Start by mapping the ML serving path end-to-end (feature retrieval, model inference, post-processing, response assembly) and identify latency hotspots at each layer before proposing targeted caching strategies. For each cache placement, explicitly justify the TTL and consistency trade-off in terms of staleness tolerance, cache hit rate, and the business/model accuracy impact of serving stale data.

    Pro tip: Google interviewers reward candidates who quantify trade-offs — mention concrete numbers like p99 latency targets, expected cache hit rates, and staleness windows (e.g., 'user embeddings can tolerate 5-minute staleness with a 95% hit rate, saving ~40ms per request'), which signals production-level thinking rather than theoretical knowledge.
    1

    Decompose the Serving Path

    Walk through each stage of the ML pipeline: feature retrieval (online store lookups), model inference (forward pass), post-processing (ranking, filtering), and response serialization. Identify which stages are the latency bottlenecks and which have cacheable outputs.

    2

    Identify Cache Placement Opportunities

    Propose caching at multiple layers: feature caches (e.g., user/item embeddings in Redis), inference result caches (for repeated or near-duplicate inputs), and response-level caches (for popular or deterministic queries). Justify each placement by its expected hit rate and latency savings.

    3

    Define TTL Strategy per Layer

    Assign TTLs based on data volatility and staleness tolerance — short TTLs (seconds to minutes) for rapidly changing features like real-time signals, longer TTLs (hours) for slowly changing embeddings or item metadata. Discuss how TTL interacts with model retraining cadence.

    4

    Address Consistency and Invalidation

    Discuss consistency strategies such as write-through vs. write-behind, event-driven invalidation (e.g., Pub/Sub on feature updates), and versioned cache keys tied to model versions to prevent serving stale predictions after a model rollout.

    5

    Quantify Trade-offs and Failure Modes

    Explicitly state the trade-off between latency gains and model quality degradation from stale data, and address failure scenarios like cache stampedes (use probabilistic early expiration or request coalescing) and cold-start misses (pre-warming strategies).

    Key Points to Mention

    Multi-layer caching: feature store cache (e.g., Redis/Memcached), inference result cache, and CDN/response-level cache for deterministic outputs
    TTL calibration tied to data volatility — distinguish between real-time signals (low TTL), user embeddings (medium TTL), and static item metadata (high TTL)
    Cache invalidation strategies: event-driven invalidation via Pub/Sub, versioned cache keys for model version alignment, and write-through vs. lazy expiration trade-offs
    Cache stampede prevention using techniques like probabilistic early expiration (PER), request coalescing/mutex locks, or background refresh
    Cold-start and pre-warming strategies to ensure cache readiness at model deployment or traffic spikes
    Monitoring and observability: tracking cache hit rate, latency percentiles (p50/p99), and staleness impact on downstream metrics like CTR or ranking quality
    A/B Testing & ExperimentationProduct Analytics & Metrics
    A
    Author's notesFirst line only

    Standard territory.

    Suggested Approach

    Structure your answer by first separating offline metrics (used during model development) from online metrics (used in live experiments), then explain how they connect to business goals. Demonstrate that you understand the limitations of each metric type and why both are necessary for a robust evaluation pipeline.

    Pro tip: Impress interviewers by acknowledging the 'proxy metric trap' — offline metrics like NDCG or precision@k often don't correlate perfectly with online business metrics like revenue or retention, and mentioning this gap shows senior-level thinking about real-world ML deployment.
    1

    Define Offline Metrics

    Start by listing ranking and relevance metrics such as NDCG, MAP, Precision@k, Recall@k, and MRR that can be computed on held-out datasets. Explain that these enable fast, cheap iteration during model development before any user exposure.

    2

    Define Online Metrics

    Identify user-behavior and business metrics like CTR, conversion rate, session length, revenue per user, and long-term retention that reflect real user satisfaction. Distinguish between guardrail metrics (e.g., latency, diversity) and primary success metrics.

    3

    Design the A/B Experiment

    Describe the experiment setup: randomized user-level or query-level splitting, control vs. treatment assignment, and the need for a holdout group. Address statistical considerations like sample size calculation, power analysis, and minimum detectable effect.

    4

    Address Experimentation Challenges

    Highlight pitfalls specific to recommender systems such as novelty bias, network effects, and position bias that can confound results. Mention techniques like interleaving experiments or counterfactual evaluation to complement standard A/B tests.

    5

    Connect Metrics to Business Goals

    Tie the evaluation framework back to the product objective — for example, balancing short-term engagement (CTR) against long-term user satisfaction (retention, diversity). Explain how you would use a metric hierarchy to make launch decisions.

    Key Points to Mention

    Offline ranking metrics: NDCG, MAP, Precision@k, Recall@k, and MRR — and their limitations as proxies for real user behavior
    Online metrics hierarchy: primary metrics (CTR, conversion, revenue), secondary metrics (session depth, return rate), and guardrail metrics (latency, diversity, fairness)
    Statistical rigor: power analysis, sample size estimation, significance thresholds, and runtime to avoid peeking problems
    Recommender-specific experiment challenges: position bias, popularity bias, novelty effects, and cold-start users skewing results
    Advanced evaluation techniques: interleaving (team-draft or balanced), counterfactual/off-policy evaluation using logged data, and holdout-based long-term measurement
    Long-term vs. short-term metric trade-offs: optimizing CTR can hurt retention if recommendations feel clickbaity, so monitoring ecosystem health metrics is critical
    System DesignTechnical Trade-offs
    A
    Author's notesFirst line only

    Answered this quickly: fallback to cached results, then popularity-based recommendations, then a lightweight rule-based system.

    Suggested Approach

    Frame your answer around the principle of graceful degradation by layering fallback strategies from fastest to slowest, ensuring the system remains functional even under partial failure. Start by identifying the failure modes (latency spikes vs. full unavailability), then walk through a tiered defense strategy that balances user experience, data freshness, and system complexity. Demonstrate awareness of real-world trade-offs between consistency, availability, and performance.

    Pro tip: Google interviewers value candidates who think in terms of SLOs and SLAs — explicitly mention how you'd define acceptable degradation thresholds (e.g., p99 latency budgets, error budgets) and how observability/alerting ties into your design, as this shows production-grade thinking beyond just the happy path.
    1

    Define Failure Modes & SLOs

    Distinguish between slow responses (high latency) and full unavailability, and establish clear SLO thresholds (e.g., timeout after 200ms) that trigger fallback behavior. This scopes the problem and shows structured thinking before jumping to solutions.

    2

    Implement Circuit Breakers & Timeouts

    Wrap all model server calls with strict timeouts and a circuit breaker pattern that opens after a configurable failure rate, preventing cascading failures and fast-failing requests instead of queuing them indefinitely. Mention libraries or patterns like Hystrix or Google's own internal equivalents.

    3

    Design a Fallback Hierarchy

    Define a tiered fallback strategy: first try a cached prediction (Redis/Memcached), then fall back to a lightweight local model or heuristic rule, and finally serve a safe default response. Each tier trades freshness/accuracy for availability and latency.

    4

    Add Caching & Precomputation

    Cache recent or high-frequency predictions at the serving layer so that a model outage doesn't immediately impact users with common inputs. For batch-friendly use cases, precompute and store predictions asynchronously to decouple serving from inference.

    5

    Observability, Alerting & Recovery

    Instrument the system with metrics (error rate, latency percentiles, fallback trigger rate) and set up alerts so on-call engineers are notified immediately. Include a strategy for graceful recovery — e.g., gradually re-routing traffic back to the model server once it stabilizes (canary re-enablement).

    Key Points to Mention

    Circuit breaker pattern with configurable thresholds to prevent cascading failures
    Tiered fallback strategy: cached predictions → lightweight/local model → rule-based heuristics → safe defaults
    Timeout budgets aligned with overall request SLOs (e.g., model call capped at a fraction of total latency budget)
    Prediction caching (in-memory or distributed cache like Redis) for high-frequency or repeated inputs
    Observability: tracking fallback rate as a key metric to detect and alert on model server degradation
    Trade-off transparency: explicitly acknowledging that fallbacks sacrifice accuracy/freshness for availability, and how to communicate this to stakeholders
    System DesignAlgorithms & Data Structures
    A
    Author's notesFirst line only

    Started with collaborative filtering as a baseline, then two-tower neural retrieval for candidate generation, then a cross-feature deep ranking model.

    Suggested Approach

    Structure your answer by first grounding the two-stage architecture in real-world scalability constraints, then walk through a concrete baseline model (e.g., collaborative filtering or BM25) before proposing an advanced ranker (e.g., a neural pointwise/pairwise/listwise model). Tie every design decision back to the trade-off between computational cost and ranking quality to show engineering maturity.

    Pro tip: Explicitly quantify the scale problem upfront — e.g., 'ranking 1 billion items in under 100ms is infeasible, so candidate generation reduces the pool to ~1,000 items' — this signals you understand why the two-stage paradigm exists at Google-scale, not just that it exists.
    1

    Motivate the Two-Stage Architecture

    Explain the core tension: exhaustive ranking over millions of items is computationally prohibitive at inference time. Candidate generation (retrieval) narrows the corpus to a manageable set so the ranker can apply expensive, high-quality features only where it matters.

    2

    Propose a Baseline Model

    Describe a simple, interpretable retrieval + ranking baseline — for example, ANN search over user/item embeddings from matrix factorization (e.g., SVD or implicit ALS) for retrieval, followed by a logistic regression ranker using hand-crafted features like CTR, recency, and popularity. Highlight why this is a strong starting point: fast to train, easy to debug, and provides a clear performance floor.

    3

    Propose an Advanced Model

    Upgrade retrieval to a dual-encoder (two-tower) neural network trained with in-batch negatives, enabling semantic matching beyond keyword overlap. Upgrade the ranker to a deep neural network (e.g., DCN-v2 or a transformer-based model) that ingests dense embeddings, sparse features, and cross-feature interactions, trained with a listwise loss like LambdaRank or softmax cross-entropy.

    4

    Explain Feature and Training Differences Between Stages

    Clarify that the retrieval stage must use only features computable offline or via fast ANN lookup, while the ranker can afford expensive real-time features (user context, query-item interaction signals, freshness). Discuss how training objectives differ: retrieval optimizes recall@K, while ranking optimizes NDCG or MAP.

    5

    Address Trade-offs, Failure Modes, and Iteration Path

    Acknowledge key risks such as retrieval recall ceiling (items not retrieved can never be ranked), training-serving skew, and feedback loops from logged data. Propose mitigations like hard negative mining, exploration strategies (epsilon-greedy or contextual bandits), and offline/online evaluation metrics (NDCG offline, A/B CTR/engagement online).

    Key Points to Mention

    Two-tower / dual-encoder architecture for scalable retrieval with approximate nearest neighbor (ANN) search (e.g., ScaNN, FAISS)
    Distinction between retrieval objective (recall@K) and ranking objective (NDCG, MAP, or pairwise AUC) and how they require different loss functions
    Feature asymmetry: lightweight features at retrieval vs. rich, expensive cross-features (e.g., feature crosses, attention over history) at ranking
    Hard negative mining and in-batch negatives to improve embedding quality in the two-tower model
    Listwise ranking losses (LambdaRank, softmax cross-entropy) vs. pointwise (binary cross-entropy) and their impact on ranking quality
    Online evaluation strategy: shadow mode testing, A/B experiments, and guardrail metrics (latency, diversity, fairness) alongside engagement metrics

    Discussion(7)

    Sign in to join the discussion.

    D
    Dev_Dan92· 58d ago
    Q6How would you design the system to degrade gracefully if the model server is slow or unavailable?

    Your answer was solid, and moving on fast probably just meant you covered it. The one thing I'd add is being explicit about the staleness window on those cached results, because at Google scale a "cached recommendation" could mean something 30 seconds old or 6 hours old, and those have very different implications for relevance. I got pushed on exactly that once: the interviewer wanted to know how I'd decide when a cached result is too stale to serve versus when popularity-based fallback is actually the better choice. Having a concrete threshold tied to your specific domain (news vs. e-commerce vs. video) makes it feel less like a checklist item.

    AH
    Alex H. Chen· 58d ago
    Q5What offline and online metrics would you track, and how would you set up experiments to evaluate the recommender?

    The diversity and novelty point landing is not surprising at all. Google has written publicly about the filter bubble problem in recommendation and it's a real product concern, not just an academic one. Interviewers there tend to respond well when you show you've thought about second-order effects of optimizing a single metric. Pure CTR optimization will eventually cannibalize session depth and long-term retention, which are the metrics the business actually cares about.

    MT
    Marcus Thorne· 58d ago
    Q3Walk me through how you'd handle cold start for both new users and new items.

    New item cold start is the harder and more interesting problem, agreed. Content-based features get you surprisingly far if your item metadata is rich, but the real unlock is usually a fast feedback loop: you push the new item into a small exploration pool, collect a few hundred impressions, and then let your ranking model start incorporating early engagement signals. The tricky part is that your ranking model was probably trained on items with rich interaction history, so a new item with 50 clicks looks worse than an established item with 50,000 even if the per-impression engagement rate is identical. One thing worth mentioning is item age as an explicit input feature so the model learns to adjust its confidence based on how much signal it has, rather than just treating sparse interaction counts as evidence of low quality.

    N
    NullPointerNikki· 58d ago
    Q2How would you design the feature store to ensure consistency between offline training and online inference?

    The TTL question is where this gets genuinely tricky, and I don't think 'it depends' is a dodge if you follow it immediately with a concrete example. The problem is most people stop there. What the interviewer probably wanted was something like: a user's age is a slow-moving feature so you can tolerate a 24-hour TTL in your online key-value store without meaningful skew, but a feature like 'items the user interacted with in the last session' goes stale in minutes and needs a nearline write path that keeps the feature store close to real-time. The point-in-time correct join for training is the right answer for the offline side, but you have to connect it explicitly to what that means at serving time: when you log a training example, you snapshot the feature values at that exact timestamp, so your model never saw 'future' feature values during training. If your online store is serving features computed an hour ago but your training data used features from the moment of the event, you have skew. The fix is making sure your feature computation logic is identical in both paths, which is the whole argument for a unified feature platform like Feast or Tecton rather than two separate pipelines that drift apart over time.

    V
    VectorVector· 58d ago
    Q4Given a strict latency budget, where would you use caching in the serving path and what TTL and consistency strategies would you apply?

    Committing to numbers is the right move. Something like: user embedding cache with a 5-10 minute TTL because user taste shifts slowly and a stale embedding is almost always better than a cache miss that blows your latency budget. Pre-computed candidate sets refreshed every 15-30 minutes via a nearline job, which is acceptable because the candidate pool is large and a slightly stale set still contains good items. Result-level caching only for non-personalized or lightly personalized surfaces (trending, new releases) where a 1-hour TTL is fine. The consistency angle is really about what failure mode you're choosing: a stale cache is a relevance problem, a cache miss under load is a latency problem. For a sub-100ms P95 target, you bias toward tolerating staleness over tolerating misses, which means longer TTLs and proactive refresh rather than lazy invalidation. The one place you'd break that rule is if a user takes an explicit action (rates something, blocks a topic) where serving them the old result feels like a product bug, not just a relevance degradation.

    S
    SamTheRecruiter· 58d ago
    Q1Design a real-time recommendation system for a large-scale mobile app that serves personalized results to millions of daily active users with sub-100ms P95 latency.

    Your instinct to open with candidate generation plus ranking was right, and I'd lean into that even harder next time. The two-stage framing does a lot of work for you structurally: it immediately signals that you understand the scale constraint, and it gives you a natural spine to hang everything else on (offline training, nearline feature refresh, online serving all slot in around those two stages rather than floating as separate concerns). The mistake I made in a similar round was treating the architecture like a whiteboard exercise and drawing boxes before I'd anchored the interviewer in the core tradeoffs. Google interviewers at this level want to see that you're reasoning about constraints, not just reciting components. The latency budget is a constraint, the corpus size is a constraint, the freshness requirement is a constraint. If you open by naming those three things and then say 'here's how the two-stage design addresses each one,' you're driving the conversation instead of reacting to nudges. The offline-nearline-online decomposition is solid framing but it's more of an implementation detail than a design rationale. Lead with why, then show the how.

    DJ
    David J. Aris· 58d ago
    Q7Propose a baseline model and then a more advanced ranking model, and explain why you'd structure it as candidate generation followed by ranking.

    The ANN follow-up is worth being ready for because it's where the two-tower answer gets real. The whole point of the two-tower architecture is that you can precompute item embeddings offline and then at query time you only need to compute the user embedding and run an approximate nearest neighbor search over the item index. If you answer 'we use ANN' and stop there, an interviewer at Google is going to push on which algorithm and why. The short version: HNSW (hierarchical navigable small world graphs) is a common choice because it has strong recall at practical latency, ScaNN is Google's own library and worth knowing about specifically for this context, and the tradeoff you're always making is index build time plus memory footprint versus query latency versus recall. Quantizing the item embeddings (product quantization or scalar quantization) reduces memory and speeds up search at some cost to recall, which is usually acceptable because your ranking stage will re-score the top candidates anyway. The two-stage design is fundamentally about that separation: retrieval optimizes for recall at speed, ranking optimizes for precision on a small set.

    Interview Details

    CompanyGoogle
    RoleMachine Learning Engineer
    RoundOnsite - System Design / Architecture
    LevelSenior
    OutcomePrefer not to say
    DateJul 2026

    Questions in this post

    Share your own experience

    Help the community by sharing what you went through.