← Amazon Interview Insights

Amazon·Data Scientist·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

Amazon system design round for a senior data scientist role, focused entirely on building a RAG pipeline for internal enterprise Q&A. One long question that kept branching into follow-ups. Left feeling like I covered the surface of everything and the depth of nothing.

Questions Asked (6)

Q1

Walk through the end-to-end architecture of a RAG system for an internal enterprise document Q&A product, from document ingestion through to the final answer with citations.

System DesignTechnical Trade-offs
Author's notes

I started with chunking strategy and worked forward, which in hindsight was the wrong entry point.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (document types, scale, latency, security) before diving into the architecture. Then walk through the pipeline stage by stage—ingestion, indexing, retrieval, generation, and citation—highlighting key design choices and trade-offs at each stage, and finish with evaluation and monitoring.

Pro tip: Emphasize enterprise-specific concerns like access control, data freshness, and auditability, and quantify trade-offs (e.g., latency vs. recall) to show you think like a production owner, not just a model builder.

1. Clarify requirements and constraints

Ask about document volume, types, update frequency, latency/throughput targets, security/compliance, and user access patterns. This frames the entire design and shows you avoid premature solutioning.

2. Document ingestion and preprocessing

Describe connectors (S3, SharePoint, Confluence), parsing (PDF/HTML/OCR), cleaning, PII redaction, and metadata extraction. Explain chunking strategy (semantic vs. fixed-size) and how it affects retrieval quality.

3. Indexing and storage

Cover embedding model choice, vector index (e.g., OpenSearch, FAISS) with hybrid search (BM25 + dense), metadata filtering for access control, and incremental updates for freshness.

4. Retrieval and ranking

Explain query understanding, hybrid retrieval, re-ranking (cross-encoder), and context assembly with deduplication. Discuss trade-offs between recall, latency, and cost.

5. Generation with citations and evaluation

Describe prompt construction with retrieved chunks, LLM choice, citation generation (source attribution), and guardrails against hallucination. Then outline offline/online evaluation (faithfulness, answer relevance) and monitoring.

Key Points to Mention

  • Chunking strategy and its impact on retrieval quality and citation granularity
  • Hybrid search (lexical + semantic) and re-ranking for improved relevance
  • Access control enforcement via metadata filtering at retrieval time
  • Citation generation by tracking source chunks and mapping to document locations
  • Evaluation metrics: retrieval recall, answer faithfulness, and end-to-end latency
  • Trade-offs: latency vs. accuracy (e.g., re-ranking cost), freshness vs. indexing cost, and cost vs. quality of LLM

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you decide between dense retrieval, sparse retrieval, or a hybrid approach for this system?

Technical Trade-offsSystem Design
Author's notes

Knew this one well enough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's requirements—query types, latency, cost, and data characteristics—then compare dense, sparse, and hybrid retrieval against those criteria. Conclude with a recommendation grounded in trade-offs and a plan to validate with offline metrics and online A/B testing.

Pro tip: Emphasize that the decision should be data-driven: propose a small pilot or experiment to measure retrieval quality and cost before committing, which shows Amazon's bias for measurable, iterative solutions.

1. Clarify requirements and constraints

Ask about query types (keyword vs. semantic), corpus size, latency SLAs, budget, and whether explainability is needed. These factors directly influence the choice.

2. Analyze data and query characteristics

Assess whether queries are short/keyword-heavy (favoring sparse) or natural language/conceptual (favoring dense), and check for domain-specific vocabulary or multilingual needs.

3. Compare trade-offs of each approach

Evaluate dense (semantic recall, higher compute cost), sparse (exact match, efficiency, interpretability), and hybrid (balanced but more complex) against the requirements.

4. Propose validation and iteration plan

Suggest offline evaluation (e.g., recall@k, MRR) and online A/B testing to measure real-world impact, with a fallback or phased rollout strategy.

5. Recommend and justify

State a clear recommendation (e.g., start with hybrid if both semantic and keyword needs exist) and explain how it aligns with business goals and scalability.

Key Points to Mention

  • Dense retrieval strengths: semantic matching, handling synonyms and paraphrases, but higher latency and cost.
  • Sparse retrieval strengths: exact term matching, efficiency, interpretability, but misses semantic nuance.
  • Hybrid approach: combines both via score fusion or reranking, often improves recall but adds complexity and tuning overhead.
  • Evaluation metrics: recall@k, MRR, NDCG for quality; latency, QPS, and cost for operational fit.
  • Amazon-specific considerations: scalability, cost-efficiency, and customer obsession—tie the choice to business impact.
  • Iterative experimentation: pilot with a subset, measure, and scale—aligns with Amazon's working backwards and A/B testing culture.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

What are the key tradeoffs you'd manage around latency, cost, context window limits, and hallucination risk in a production RAG setup?

Technical Trade-offsSystem Design
Author's notes

This felt like four questions in one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the four factors as an interconnected optimization problem, not independent knobs. Walk through each tradeoff with a concrete example of how changing one affects the others, then describe how you'd instrument and monitor the system to make data-driven decisions. Anchor your answer in a real or hypothetical production scenario to show practical judgment.

Pro tip: Emphasize that these tradeoffs are dynamic—what works at low query volume may fail at scale—so you'd build feedback loops (e.g., A/B tests, canary deployments, online metrics) to continuously rebalance rather than set-and-forget. Mentioning cost-per-query and p95 latency as explicit SLOs signals Amazon-style operational rigor.

1. Map the tradeoff landscape

Briefly define each factor and explain how they interact—e.g., larger context windows reduce hallucination risk but increase latency and cost; more retrieval improves grounding but adds latency.

2. Prioritize based on business and user impact

Explain how you'd rank these tradeoffs for the specific use case (e.g., customer-facing Q&A vs. internal analytics), tying latency and hallucination risk to user trust and cost to unit economics.

3. Design concrete mitigation strategies

Propose specific techniques for each axis: caching and model distillation for latency/cost, chunking and re-ranking for context limits, and citation/verification layers for hallucination risk.

4. Instrument and monitor

Describe the metrics and dashboards you'd build (p50/p95 latency, cost per query, retrieval precision/recall, hallucination rate via human eval or automated checks) to detect drift and regressions.

5. Iterate with controlled experiments

Explain how you'd use A/B tests, canary releases, and offline evaluations to safely tune the system, and how you'd set thresholds to trigger rebalancing.

Key Points to Mention

  • Latency vs. retrieval depth: more retrieved documents improve grounding but increase response time; use re-ranking and caching to mitigate.
  • Cost vs. context window: larger context windows and bigger models raise cost per query; consider chunking, summarization, or smaller fine-tuned models.
  • Hallucination risk vs. coverage: stricter grounding reduces hallucinations but may lower answer rate; use confidence thresholds and fallback to 'I don't know'.
  • Monitoring and evaluation: track p95 latency, cost per query, retrieval precision/recall, and hallucination rate with automated and human-in-the-loop checks.
  • Dynamic rebalancing: use A/B tests, canary deployments, and feedback loops to adjust tradeoffs as traffic and data drift.
  • Amazon-specific lens: tie decisions to customer trust (hallucinations), operational excellence (latency SLOs), and frugality (cost per query).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you handle missing or null metadata, stale documents, duplicate content, and permission-scoped documents in the pipeline?

System DesignData Modeling
Author's notes

Permissions was the part I actually felt good about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer by walking through each data quality issue (missing metadata, stale docs, duplicates, permission-scoped docs) and describe detection, handling, and monitoring strategies. Emphasize a systematic pipeline design with validation, deduplication, freshness checks, and access control enforcement. Tie your approach to business impact and scalability, showing you consider both data quality and security.

Pro tip: Mention that you would implement data quality checks as automated gates in the pipeline with alerts, and that you'd track metrics like null rate and duplicate rate over time to catch regressions. This shows you think about production reliability, not just one-off fixes.

1. Detect and validate

Implement automated validation checks at ingestion to flag missing/null metadata, stale timestamps, and duplicate signatures. Use schema validation, null checks, and freshness thresholds.

2. Handle missing or null metadata

Define fallback strategies: impute defaults, quarantine records for manual review, or enrich from external sources. Log and monitor null rates to identify upstream issues.

3. Manage stale documents

Set freshness SLAs and use timestamp-based filtering or re-crawl triggers. Downrank or exclude stale docs from search/indexing, and alert on staleness trends.

4. Deduplicate content

Use hashing, similarity detection (e.g., MinHash, embeddings), or canonical IDs to identify duplicates. Deduplicate at ingestion or query time, and track duplicate rates.

5. Enforce permission-scoped documents

Apply access control at ingestion and query time, tagging documents with permission metadata and filtering results based on user scope. Audit permissions regularly and handle missing permissions as deny-by-default.

Key Points to Mention

  • Automated data quality gates with alerts and dashboards for null rates, staleness, and duplicates
  • Fallback and quarantine strategies for missing metadata, with root-cause analysis
  • Freshness SLAs and timestamp-based filtering for stale documents
  • Deduplication techniques: hashing, similarity detection, canonical IDs
  • Permission enforcement: tagging, filtering, deny-by-default, and auditing
  • Scalability and monitoring: metrics, logging, and iterative improvement

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How would you evaluate this system both offline and online, covering model quality, business impact, and guardrail metrics?

Product Analytics & MetricsA/B Testing & Experimentation
Author's notes

Offline I covered: answer faithfulness, retrieval precision and recall, and a labeled QA benchmark.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the evaluation in two phases: offline evaluation to validate model quality before deployment, and online A/B testing to measure business impact and guardrail metrics. Emphasize the importance of aligning offline metrics with online objectives and using guardrails to catch unintended harm.

Pro tip: Demonstrate Amazon's customer-obsession by linking every metric to customer experience—e.g., how a guardrail like page load time or return rate protects long-term trust, not just short-term revenue.

1. Define evaluation goals and metrics

Clarify the model's purpose and map offline metrics (e.g., AUC, precision@k) to online business metrics (e.g., conversion, revenue) and guardrails (e.g., latency, return rate).

2. Conduct offline evaluation

Use held-out data, cross-validation, and backtesting to assess model quality; check for bias, robustness, and alignment with business constraints.

3. Design and run online A/B test

Set up a controlled experiment with proper randomization, sample size, and duration; measure primary business metrics and guardrails to detect regressions.

4. Analyze results and iterate

Compare offline and online outcomes, investigate discrepancies, and decide whether to launch, iterate, or abandon based on statistical and practical significance.

Key Points to Mention

  • Offline metrics: AUC, precision/recall, NDCG, calibration, and business-aligned metrics like expected revenue
  • Online metrics: conversion rate, revenue per user, click-through rate, and customer satisfaction
  • Guardrail metrics: latency, error rates, return rate, unsubscribe rate, and long-term customer value
  • A/B testing best practices: randomization unit, power analysis, novelty effects, and sequential testing
  • Offline-online gap: reasons like data leakage, distribution shift, and feedback loops
  • Amazon leadership principles: customer obsession, dive deep, and insist on highest standards

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

When would you choose RAG over fine-tuning, and what failure modes do you expect to see in a production RAG system?

Technical Trade-offsProduct Strategy
Author's notes

Preferred RAG when the knowledge base changes frequently and you can't afford retraining cycles.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing RAG vs. fine-tuning as a trade-off between dynamic knowledge access and model behavior adaptation, then give concrete criteria (e.g., data freshness, cost, latency) for choosing RAG. Transition into production failure modes by categorizing them (retrieval, generation, system-level) and tie each to mitigation strategies, showing end-to-end thinking.

Pro tip: Emphasize that RAG and fine-tuning are complementary—many production systems use fine-tuning for style/format and RAG for facts—and mention that evaluating RAG requires retrieval-specific metrics (e.g., recall@k) beyond generation quality.

1. Define the decision criteria

Explain that RAG is preferred when knowledge is dynamic, large, or needs provenance, while fine-tuning suits fixed behavior, style, or domain adaptation. Mention cost, latency, and maintenance as key factors.

2. Highlight RAG advantages

Discuss how RAG enables real-time updates, reduces hallucination by grounding in retrieved documents, and provides auditability—critical for enterprise and Amazon-scale applications.

3. Acknowledge fine-tuning strengths

Note that fine-tuning can improve task-specific performance, reduce prompt length, and enforce consistent output formats, but requires labeled data and retraining for updates.

4. Enumerate production failure modes

Categorize failures: retrieval (irrelevant/missing docs, chunking issues), generation (hallucination, ignoring context, verbosity), and system (latency, staleness, scaling).

5. Propose mitigations and evaluation

Suggest concrete mitigations like hybrid search, reranking, guardrails, and monitoring retrieval metrics; emphasize continuous evaluation with both retrieval and generation metrics.

Key Points to Mention

  • Data freshness and update frequency as a key differentiator
  • Cost and latency trade-offs: RAG adds retrieval latency but avoids retraining costs
  • Provenance and auditability: RAG can cite sources, important for trust and compliance
  • Retrieval failure modes: poor recall, chunking strategy, embedding mismatch, stale index
  • Generation failure modes: hallucination despite context, context window overflow, ignoring retrieved evidence
  • Hybrid approaches: combining fine-tuning for style with RAG for facts, and using rerankers or query rewriting

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.