Last week, a message landed in my LinkedIn DMs at 11 PM.
"Bhai, I just finished my Google GenAI interview. Round 2 went really well. I want to share the questions — please post this so others can benefit."
The sender was Arjun — a Senior ML Engineer with 6 years of experience, who had been quietly preparing for a Google role for four months. He'd applied, cleared the screening, and just wrapped up two technical rounds for a GenAI Engineer (L4) position.
He messaged me because he'd been following my GenAI interview content for months. And now he wanted to give back.
I'm sharing his full experience here — every question, every answer — exactly as he described it to me. If you're targeting Google or any top-tier AI role, read this carefully.
Walk me through a GenAI project you've built end to end. What problem did it solve and what were the hard parts?
Arjun said the interviewer wasn't interested in a portfolio tour — they wanted to understand engineering depth. So he picked one project and went deep.
He described a document intelligence system built for a legal firm — ingesting thousands of case files, extracting key clauses, and answering natural language queries with cited evidence. The stack: Vertex AI embeddings + BigQuery vector search + Gemini Pro + FastAPI.
The "hard parts" he highlighted:
- Chunking strategy: Legal documents have complex hierarchy — chapters, sections, sub-clauses. Naive fixed-size chunking broke semantic meaning. He switched to recursive character splitting with metadata tagging per chunk.
- Hallucination in citations: The LLM would confidently cite clause numbers that didn't exist. He solved this by building a post-generation verifier that checked every cited clause against the original document index.
- Latency: Gemini Pro calls averaged 3–4 seconds. He added response streaming and pre-cached embeddings for top 500 frequent queries.
Explain how the Attention mechanism works. Why was it a breakthrough over seq2seq models?
This is fundamental — but Google expects you to explain it with mathematical intuition, not just a high-level description.
How Attention Works
In the attention mechanism, every token in the input produces three vectors: a Query (Q), a Key (K), and a Value (V) — all learned linear projections of the input embedding.
The attention score between two tokens is computed as:
Attention(Q, K, V) = softmax(QKᵀ / √dₖ) · VQKᵀmeasures similarity between a query and all keys — how much should this token attend to others?√dₖscaling prevents softmax from saturating in high dimensions.softmax()converts raw scores into a probability distribution.- The result is a weighted sum of Values — each token gets a context-aware representation.
Why It Was a Breakthrough
Classic seq2seq (RNN encoder-decoder) had a bottleneck: the entire input had to be compressed into a single fixed-size context vector. For long sequences, early information was lost by the time the decoder started generating.
Attention solved this by letting the decoder look directly at all encoder hidden states at each generation step — weighted by relevance. The decoder could "attend" to whichever part of the input mattered most for the current output token.
What is the difference between SFT, RLHF, and RLAIF? When would you use each?
Google is deep in alignment research. This question tests whether you understand how LLMs are trained beyond the pretraining phase.
SFT — Supervised Fine-Tuning
- Fine-tune a pretrained LLM on high-quality human-written (prompt, response) pairs.
- Teaches the model how to respond — format, tone, instruction following.
- First step in the alignment pipeline (used in InstructGPT, Gemini).
- When to use: When you have high-quality labeled data and want to teach a specific behavior or domain.
RLHF — Reinforcement Learning from Human Feedback
- Humans rank multiple model outputs → a Reward Model is trained on these rankings → LLM is fine-tuned with PPO to maximize reward.
- Aligns the model with human preferences — helpfulness, harmlessness, honesty.
- Limitation: Expensive and slow — requires thousands of human preference labels.
- When to use: When you need deep alignment with human values and have budget for human annotation.
RLAIF — Reinforcement Learning from AI Feedback
- Replaces human rankers with a powerful AI (e.g., Claude, GPT-4) to generate preference labels.
- Dramatically cheaper and faster than RLHF — can scale to millions of comparisons.
- Google's Constitutional AI and Anthropic's CAI are built on this idea.
- When to use: When you need to scale alignment training beyond what human annotation can support.
| Method | Feedback Source | Cost | Best For |
|---|---|---|---|
| SFT | Human-written examples | Medium | Teaching behavior/format |
| RLHF | Human preference rankings | High | Deep human alignment |
| RLAIF | AI preference rankings | Low | Scalable alignment |
What are the limitations of RAG and how do you address them in production?
Arjun said this was the question that made the interviewer lean forward. They didn't want "RAG is good because…" — they wanted the failure modes.
Limitation 1: Retrieval Failure (Wrong Chunks)
The most common failure — semantically similar but contextually wrong chunks get retrieved. A question about "model training cost" might pull chunks about "cost functions" instead of "compute costs."
Fix: Hybrid search (dense + BM25 keyword), query rewriting, HyDE (generate a hypothetical answer, embed that for retrieval instead of the raw question).
Limitation 2: Context Window Overflow
Retrieving too many chunks exceeds the LLM's context window — or dilutes the relevant signal with noise.
Fix: Cross-encoder re-ranking to keep only the top-3 most relevant chunks. Smaller, denser chunks at indexing time.
Limitation 3: Hallucination on Retrieved Context
Even with the right context, the LLM may generate claims not supported by the retrieved text.
Fix: Faithfulness scoring (RAGAs), post-generation citation verification, constrained generation prompts ("only use information from the provided context").
Limitation 4: Stale Index
The vector index becomes stale as source documents update. Answers reflect outdated information.
Fix: Incremental indexing pipelines triggered on document updates. Timestamp metadata on chunks + recency-weighted retrieval.
Limitation 5: Multi-Hop Reasoning
Questions that require connecting information from multiple documents (e.g., "Which of our clients in Region A had contracts affected by Policy X?") can't be answered by a single retrieval step.
Fix: Agentic RAG — an agent iteratively retrieves, reasons, and retrieves again until it has enough context to answer.
How does Google's Gemini differ architecturally from GPT-4? What do you know about mixture-of-experts?
Arjun said he expected this — it's Google, of course they'd ask about their own model.
Gemini's Key Architectural Differences
- Natively multimodal: Gemini was trained from scratch on text, images, audio, and video simultaneously — not retrofitted. GPT-4V added vision post-hoc to a text model.
- MoE architecture (Gemini 1.5+): Gemini 1.5 uses a Mixture of Experts architecture — only a subset of model parameters are activated per token, dramatically improving efficiency.
- Long context: Gemini 1.5 Pro supports a 1M token context window — enabling entire codebases, hour-long videos, or thousands of documents in one prompt.
- TPU-optimized: Designed to run on Google's TPU v5 infrastructure — architecture decisions (tensor shapes, attention patterns) are TPU-aware.
Mixture of Experts (MoE) — Explained
In a standard dense transformer, every token passes through every parameter in every layer — expensive. In MoE:
- Each transformer layer has multiple "expert" feed-forward networks (e.g., 64 experts per layer).
- A router network learns to send each token to the top-2 most relevant experts.
- Only those 2 experts activate for that token — the rest are dormant.
- Result: A model with the parameter count of a huge dense model, but the inference cost of a much smaller one.
Design a production-grade GenAI system for a customer support chatbot that handles 100K queries per day. Walk through every component.
This was the big one. 25 minutes on this question alone. Arjun said he drew the architecture on Google Docs (shared screen) and explained each layer.
Layer 1: Ingestion & Indexing (Offline)
- Knowledge base (FAQs, product docs, past tickets) ingested via a batch pipeline.
- Chunked with semantic splitter, embedded with
text-embedding-004(Vertex AI). - Stored in Vertex AI Vector Search (managed, scalable, Google-native).
- Metadata attached: product category, last updated date, source URL.
Layer 2: Query Pipeline (Online)
- Input guardrails: PII detection (Google DLP API), toxicity filter, prompt injection detection.
- Query rewriting: LLM expands ambiguous queries into 3 search variants.
- Hybrid retrieval: Vertex AI Vector Search (dense) + Elasticsearch BM25 (keyword) → merged, re-ranked with a cross-encoder.
- Generation: Gemini 1.5 Flash (latency-optimized) with retrieved context injected. System prompt enforces response length, tone, and citation format.
- Output guardrails: Faithfulness check, hallucination detection, profanity filter.
Layer 3: Infrastructure
- API: FastAPI on Cloud Run — auto-scales from 0 to 1000 instances.
- Cache: Redis for semantic caching — if a new query is 95%+ similar to a cached query's embedding, return cached response. Cuts LLM cost by ~40%.
- Queue: Pub/Sub for async processing of non-urgent queries.
Layer 4: Observability & Evaluation
- Every query logged: input, retrieved chunks, response, latency, token count.
- 5% of responses sampled daily → LLM-as-Judge scores faithfulness + relevance.
- Dashboards in Looker: hallucination rate, avg latency, cache hit rate, cost per query.
How would you handle hallucinations in a high-stakes production system — say, a medical or legal chatbot?
This tests your thinking on responsible AI — critical for Google's AI principles.
Arjun's layered defense approach:
- Constrained generation: System prompt explicitly instructs the model to only use provided context and to respond with "I don't have enough information" if the context is insufficient — never to extrapolate.
- Citation enforcement: Every claim must reference a specific chunk ID. A post-processing step verifies every citation exists in the retrieved context. Claims without valid citations are flagged or removed.
- RAGAs Faithfulness scoring: Automated faithfulness check on every response. Responses below a threshold (e.g., < 0.85) are blocked and returned as "Unable to answer confidently — please consult a professional."
- Human-in-the-loop for edge cases: Low-confidence responses are routed to a human reviewer queue instead of being shown to the user.
- Dual-LLM verification: A second LLM (with a different prompt) independently scores whether the primary response contradicts the retrieved context. Disagreements trigger a review.
- Audit trail: Every response, retrieved chunk, and confidence score is logged immutably for compliance review.
What is the difference between fine-tuning and prompt engineering? When does fine-tuning actually beat prompting?
Arjun said this felt like a trick question — the obvious answer is "fine-tuning is better for complex tasks." But that's wrong at Google scale.
| Dimension | Prompt Engineering | Fine-Tuning |
|---|---|---|
| Speed | Instant iteration | Hours to days of training |
| Cost | Only inference cost | Training + inference cost |
| Data needed | 0–few examples | Hundreds to thousands of pairs |
| Token cost | High (long prompts) | Lower (shorter prompts post-FT) |
| Consistency | Can vary with phrasing | Baked into weights — stable |
When fine-tuning actually wins:
- When you need consistent output format and prompting can't enforce it reliably.
- When token cost is significant — fine-tuning lets you use much shorter prompts.
- When the task requires domain knowledge the base model genuinely lacks (rare medical terminology, proprietary code patterns, internal jargon).
- When latency is critical — a fine-tuned smaller model can outperform a prompted larger model and run faster.
Given a list of integers, find the length of the longest consecutive sequence. Time complexity must be O(n).
Google coding rounds are always in Google Docs — no IDE, no autocomplete. Just you and a blank page. Arjun had 15 minutes for this.
He immediately recognized this as a hash set problem — the key insight being: only start counting from the beginning of a sequence (where num - 1 is NOT in the set).
Why this is O(n):
- Building the set: O(n).
- The inner
whileloop looks scary — but across the entire algorithm, each number is visited at most twice (once in the outer loop, once in the while loop). Total operations: O(2n) = O(n). - The guard
if num - 1 not in num_setensures we only start counting from sequence beginnings — preventing redundant traversals.
What Google Is Actually Testing
Arjun debriefed with me for an hour after his rounds. His takeaway wasn't about the questions — it was about the level of thinking Google expects.
"They don't care if you know every term," he told me. "They care if you can reason about systems under constraints. Every answer I gave, the follow-up was 'what's the trade-off?' or 'how does this break at scale?'"
If you're targeting Google or any top-tier AI role, here's what he'd tell you to focus on:
- Know the failure modes, not just the happy path. RAG failures, hallucination sources, attention limitations — Google wants the full picture.
- Google's ecosystem matters. Know Vertex AI, BigQuery ML, Gemini, TPUs at a conceptual level. Using their products in your answers signals cultural fit.
- System design is the separator. Most candidates can explain RAG. Far fewer can design a production RAG system for 100K queries/day with caching, guardrails, and cost tracking.
- Code on a blank doc. Practice LeetCode in a plain text editor — no hints, no syntax highlighting. Google Docs is unforgiving.
- Always mention trade-offs. Dense model vs MoE, fine-tuning vs prompting, speed vs accuracy — every design decision has two sides. Show both.
If Arjun's experience helped your prep — give this a clap. It lets me know to keep sharing these real stories.
Do you have an interview experience at Google, Microsoft, or any top AI firm? DM me on LinkedIn — I'll share your story (anonymously if you prefer) so the community benefits.
Follow me for daily GenAI interview breakdowns — one real company, every single day.