Real Interview Questions for the AI Engineer at Google
New
Practice MCQs
Answers count toward the AI Engineer and overall leaderboards; your latest answer to each question is the one that counts.
MCQ-1A decoder layer scores one query against three keys with `d_k = 4`, so each dot product is scaled by `1/2`. The query is `[1, 1, 0, 0]`, the keys are `[2, 0, 0, 0]`, `[0, 1, 0, 0]` and `[0, 0, 0, 0]`, and the third key is a padding position that must not contribute to the output. The value rows are `[1, 0]`, `[0, 1]` and `[1, 1]`. Which output row does the layer return?⌄
MCQ-2A dedup service holds 50M 768-dim float32 embeddings on a 128 GB node. IVF-PQ with 96 one-byte subquantizers and `nlist=4096` takes 4.8 GB, leaving 8 GB of headroom; the exact vectors sit on SSD, measured at 400 MB/s for 3 KB random reads. At `nprobe=64` p99 is 14 ms, 9 ms of it scanning, and recall@10 is 0.68; the true top-10 is inside the PQ top-50 for 88% of queries and inside the top-200 for 97.4%. The bar is 0.95 recall within 25 ms. Which change meets it?⌄
MCQ-3A 30-block stack computes `y = x + F(x)` per block, where `F` is linear with `∂F/∂x = -0.9` at every block. A teammate says the identity path guarantees gradients reach block 1 undiminished. Backprop from the loss to the stack's input multiplies the 30 block Jacobians. Which factor does the gradient pick up, and what does it show about the identity path?⌄
MCQ-4A scalar parameter starts at 0 and receives the same gradient, 2.0, on each of its first three steps. Run A is Adam with `lr = 0.1`, `β1 = 0.9`, `β2 = 0.999`, `eps = 1e-8`; run B is SGD with momentum 0.9 and the same `lr`, both in PyTorch's formulation. Where does each run leave the parameter after three steps?⌄
MCQ-5A team's checklist requires np̂ ≥ 10 and n(1−p̂) ≥ 10 before it trusts a Wald interval. For a 2% defect rate from 200 sampled items with 4 defects, the Wald interval is [0.0006, 0.0394]. Which account of that interval, and which interval to report instead, is right?⌄
MCQ-6A 7B model is served with `top_k = 50`, `top_p = 1.0` and `temperature = 1.0`. At one step the softmax puts 0.60 on token A and spreads the other 0.40 evenly over 5,000 tokens at 0.00008 each, and the reference continuation needs one of those tail tokens. What does the sampler do at that step?⌄
MCQ-7A 32-layer decoder with 8 KV heads and `head_dim` 128 serves 128k-token contexts in fp16 KV cache under a 3 GiB per-sequence budget. On the team's needle eval a fact at token 100 must be recalled at token 120,000; pure sliding-window attention at 4,096 tokens scores 0.41 against a 0.95 bar. Which change meets both the budget and the bar?⌄
MCQ-8A RAG assistant over 500 policy documents answers a 500-question eval; 100 answers are wrong. For each wrong answer the team logged where the gold passage sat: among the 5 retrieved chunks for 78, at rank 6-10 for 15, and absent from the top 50 for 7. Which reading of these numbers, and which next step, is right?⌄
MCQ-9A 70B model must absorb 2B tokens of a new domain language. A pilot compared full fine-tuning (AdamW, bf16 mixed precision) with rank-16 and rank-64 LoRA on all linear layers: 84.2, 72.4 and 76.1 on domain-knowledge questions, all three equal on format. Training now runs on 64 H100 80GB cards; each serving replica has 4 H100 80GB cards and needs 60 GB for KV cache. Which training and serving plan fits both budgets?⌄
MCQ-10A 7B model trains in bf16 with AdamW (`β2 = 0.95`), grad clip 1.0 and checkpoints every 1,000 steps; it is bitwise deterministic for a given checkpoint and data order. At step 41,200 loss jumps from 2.28 to 11.4 and grad norm from 0.7 to 512. Resuming from the step-41,000 checkpoint with its optimizer state and the same data reproduces the spike at exactly 41,200; resuming from it with the same data but Adam moments zeroed runs through cleanly. Which diagnosis and resume plan is right?⌄
MCQ-11A 12B-parameter model trains in mixed precision (fp16 parameters and gradients, fp32 master weights, Adam `m` and `v`) on 32 GPUs of 80 GB each. Each GPU reserves 6 GB for the CUDA context and budgets 46 GB for activations and workspace. Which configuration fits the remaining memory, and what does it move per GPU per step?⌄
MCQ-12Your release harness compares baseline `m-7b-v3` and candidate `m-7b-v4` on the same 2,000 prompts. Today both load into one Python process: a module-level `random` is seeded once, the candidate's tokenizer sets `TOKENIZERS_PARALLELISM=true` globally, and rerunning the same command moves the candidate's score from 71.2 to 70.4 while the baseline stays at 70.9. Which harness change makes the comparison reproducible and defensible?⌄
MCQ-13A moderation pipeline scores 1,000,000 videos/hour. A cheap stage-1 classifier runs on every video and flags 5% of traffic; only flagged videos reach human reviewers, who wrongly clear 5% of the true violations they see, and the review queue already sits at 6 hours p99. 2% of videos violate policy and stage 1 catches 90% of them; a sweep shows threshold 0.2 gives 98% stage-1 recall at a 15% flag rate. Which reading of the pipeline, and which change, is right?⌄
MCQ-14A serving team runs an 8B model with 32 layers, 8 KV heads and `head_dim` 128 on one 80 GB GPU: 16 GB of weights, 6 GB of activations and workspace, and 10 GB of headroom leave 48 GiB for KV cache. They set the cache to int8 and sized for 128 sequences of 4,096 tokens, but the process is OOM-killed at 128 sequences and runs at 96. Which account of the cache is right?⌄
MCQ-15A recommender must answer in 120 ms p99. Candidate generation takes 18 ms, the ranker 0.05 ms per candidate, and the DPP re-ranker 0.02 ms per pair over the list it re-ranks (`n(n-1)/2` pairs). Today it ranks 1,000 and re-ranks 100, and p99 is 167 ms. Offline, recall@1000 is 0.93 and recall@500 0.72 (bar 0.90); diversity is 0.78 for DPP over the served 50, 0.71 for DPP over 100 truncated to 50, 0.61 for a 5-per-category cap (bar 0.75). Which plan meets the budget and both bars?⌄
MCQ-16A GCP RAG assistant must hold p95 under 800 ms at 10k QPS. Measured p95 is 900 ms: embedding 40, Vector Search 60, rerank of 100 candidates 350 (3.5 ms each, linear), Gemini generation 320, citation check 110, overhead 20. Recall@100 is 0.985 and recall@50 0.962 against a 0.98 bar, 8% of queries repeat, every cited span must be verified before the response is sent, and the eval's reference answers all stay under 150 tokens. Which change holds p95 under 800 ms?⌄
MCQ-17Gmail Smart Reply `sr-v4` ships with `temperature=0.9`, `top_p=0.95` and no tone reranker. It lifts reply rate 1.5 pp overall, but 'pushy' reports rise from 1.1% to 3.4%; the lift is +4.1 pp on threads ending in a question and +0.2 pp elsewhere, and an offline tone classifier flags 6.2% of v4 suggestions vs 2.0% for v3. Which first change and verification plan is right?⌄
MCQ-18A 12-layer encoder fine-tunes on 40M queries over 1,200 intents; 60 rare intents hold under 500 examples each and 0.3% of traffic. Train loss falls 0.41 to 0.09 and head AUC holds at 0.93, but rare AUC slips 0.88 to 0.86 and rare ECE rises 0.03 to 0.17 while head ECE stays flat. Rare penultimate centroids average 0.94 pairwise cosine (head 0.28); rare classifier rows have L2 norm 0.11 against 1.7 for head rows. Which diagnosis and pair of first changes is right?⌄
MCQ-19A consumer app team must 'add AI to search' six weeks before launch with two engineers. Search returns no results for 12% of queries; product wants engagement, support wants that down, and legal forbids any answer not backed by a cited passage. The team has 2,000 past queries with click logs but no relevance labels, plus last month's audit of 200 zero-result queries, already tagged by support and legal: 118 had no matching document, 82 did. Which first step sets the target and gets sign-off?⌄
MCQ-20Your lead wants the 24-layer reranker. The retriever returns a fixed top-100; recall@100 is 0.985, @60 0.968, @45 0.91, against a 0.95 bar. Fixed pipeline cost is 140 ms inside a 250 ms p99 budget, and reranking costs 0.9 ms per candidate at 12 layers and 2.4 ms at 24. Eval NDCG@10: 12-layer 0.412 at 100 candidates and 0.404 at 60; 24-layer 0.431 at 100, 0.427 at 60, 0.421 at 45. Which configuration ships?⌄
MCQ-21`rank-v7` has held NDCG@10 at 0.412 for three days at 20k QPS. At 13:50 `feat-v3` reached 100% of traffic; by 16:00 NDCG@10 is 0.377 in every segment. `user_embedding_norm` mean moved 1.00 → 1.31, `item_age_days` PSI is 0.02, and today's labels land 24 hours late. `feat-v3` and `rank-v7` each ship as one artifact with no per-change flags. Which action should the team take first?⌄