← Amazon Interview Insights

Amazon·Software Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Amazon Applied Scientist technical screen covering ML fundamentals and a bunch of LLM-specific stuff. Pretty broad range, felt like they were stress-testing whether you actually know the theory or just know the buzzwords.

Questions Asked (5)

Q1

What is the difference between overfitting and underfitting, how do you detect each, and what are your options for fixing them?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Felt pretty solid here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining overfitting and underfitting in simple terms, then explain how to detect each using learning curves and performance metrics, and finally discuss a range of remedies from data augmentation to regularization. Emphasize the bias-variance trade-off and how you would systematically diagnose and address the issue in a real-world scenario.

Pro tip: Mention that in practice, you often start with a simple model to establish a baseline and then incrementally increase complexity while monitoring validation performance, rather than jumping straight to complex models.

1. Define the concepts

Clearly explain overfitting as high variance where the model memorizes training data but fails to generalize, and underfitting as high bias where the model is too simple to capture underlying patterns.

2. Detection methods

Describe how to use learning curves (training vs validation error) and metrics like accuracy, precision, recall, or RMSE to identify overfitting (large gap between training and validation performance) and underfitting (both training and validation performance are poor).

3. Fixing overfitting

List techniques such as collecting more data, data augmentation, regularization (L1/L2), dropout, early stopping, reducing model complexity, and ensemble methods.

4. Fixing underfitting

Discuss increasing model complexity, adding more features, reducing regularization, training longer, or using a more powerful model architecture.

5. Trade-off and iteration

Explain that the goal is to find the sweet spot between bias and variance, and that it requires iterative experimentation, possibly using cross-validation to tune hyperparameters.

Key Points to Mention

  • Bias-variance trade-off
  • Learning curves and validation curves
  • Regularization techniques (L1, L2, dropout)
  • Cross-validation for reliable performance estimation
  • Data augmentation and feature engineering
  • Early stopping and model complexity control

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

Q2

Compare L1 and L2 regularization. How do they differ in terms of sparsity, their geometric interpretation, and gradient behavior?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

The geometry angle is the one that trips people up and I knew it was coming so I had it prepped.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining L1 and L2 regularization and their formulas, then systematically compare sparsity, geometric interpretation, and gradient behavior. Use concrete examples or visualizations to illustrate the differences, and conclude with practical implications for model training.

Pro tip: Emphasize that L1 regularization is like a diamond constraint that pushes coefficients to zero, while L2 is a circle that shrinks them smoothly. Mention that in practice, L1 is preferred for feature selection, but L2 often yields better predictive performance when all features are relevant.

1. Define L1 and L2

State that L1 adds the sum of absolute weights to the loss, while L2 adds the sum of squared weights. Mention the regularization parameter lambda controls the strength.

2. Discuss sparsity

Explain that L1 tends to produce sparse solutions with many weights exactly zero, effectively performing feature selection. L2 produces small but non-zero weights, leading to dense solutions.

3. Explain geometric interpretation

Describe the constraint regions: L1 is a diamond (or hypercube) with corners on axes, so the loss contours often intersect at corners, yielding zeros. L2 is a circle (or hypersphere) with no corners, so intersections are typically non-zero.

4. Compare gradient behavior

For L1, the gradient is constant sign(weight) times lambda, causing a constant push toward zero. For L2, the gradient is 2*lambda*weight, proportional to weight, so it shrinks weights smoothly.

5. Summarize practical implications

Conclude that L1 is useful for feature selection and interpretability, while L2 is better for preventing overfitting when all features contribute. Mention elastic net as a combination.

Key Points to Mention

  • L1 regularization adds |w| to the loss; L2 adds w^2.
  • Sparsity: L1 yields zero weights, L2 yields small weights.
  • Geometric: L1 constraint is a diamond, L2 is a circle.
  • Gradient: L1 has constant gradient magnitude, L2 gradient proportional to weight.
  • L1 can be solved with subgradient methods; L2 has smooth gradients.
  • Practical: L1 for feature selection, L2 for weight decay, elastic net combines both.

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

Q3

Can you explain how LoRA works and why it's useful for adapting large language models?

Technical Trade-offsSystem Design
Author's notes

Low-rank decomposition of weight update matrices, keeps the base model frozen, way fewer trainable parameters.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining LoRA in simple terms: it freezes the original model weights and injects trainable low-rank matrices into each layer, drastically reducing the number of parameters to update. Then explain the mathematical intuition (low-rank decomposition) and why this is useful for adapting LLMs: it's parameter-efficient, reduces memory and compute, enables quick task switching, and maintains performance close to full fine-tuning. Finally, connect it to real-world benefits like cost savings and scalability, especially in cloud environments like AWS.

Pro tip: Mention that LoRA's low-rank adaptation often achieves performance comparable to full fine-tuning while being 10,000x more parameter-efficient, and that you can serve multiple LoRA adapters on a single base model, which is a huge win for multi-tenant systems.

1. Define LoRA

Explain that LoRA (Low-Rank Adaptation) is a technique that freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture.

2. Explain the mechanism

Describe how for a weight matrix W, LoRA adds a low-rank update BA, where B and A are smaller matrices. Only these new matrices are trained, while W remains fixed.

3. Highlight efficiency gains

Emphasize that this reduces trainable parameters by orders of magnitude, lowering GPU memory requirements and allowing fine-tuning on a single GPU.

4. Discuss practical benefits

Mention that LoRA enables fast adaptation to new tasks, easy swapping of adapters, and no inference latency overhead when merged with the base model.

5. Connect to Amazon context

Relate to Amazon's scale: LoRA can reduce costs for deploying many fine-tuned models, support multi-tenant serving, and accelerate experimentation.

Key Points to Mention

  • Low-rank decomposition: ΔW = BA, where B and A are much smaller than W.
  • Parameter efficiency: only a small fraction of parameters are trained, reducing memory and compute.
  • No inference latency: after training, BA can be merged with W, so no extra computation at inference.
  • Task switching: multiple LoRA adapters can be trained for different tasks and swapped at runtime.
  • Performance: often matches full fine-tuning on many benchmarks.
  • Scalability: enables fine-tuning of very large models on limited hardware, crucial for cloud services.

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

Q4

How does retrieval-augmented generation work and what problems does it solve?

System DesignTechnical Trade-offs
Author's notes

Standard setup: retriever pulls relevant docs at inference time, they get stuffed into the context, the model generates conditioned on that.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining RAG and its core components, then explain the retrieval-generation pipeline step by step. Focus on the problems it solves, such as knowledge cutoff, hallucination, and domain adaptation, and tie them to real-world engineering trade-offs like latency and cost.

Pro tip: Emphasize that RAG is not just about adding a retriever; it's about designing a system that balances retrieval quality, generation fidelity, and operational constraints. Mention how you would evaluate and iterate on each component separately.

1. Define RAG and its purpose

Briefly explain that RAG combines a retrieval system with a generative model to produce answers grounded in external knowledge. State that it addresses limitations of standalone LLMs.

2. Describe the retrieval-generation pipeline

Outline the typical flow: query encoding, document retrieval from a knowledge base, and conditioning the generator on retrieved passages. Mention key components like retriever, index, and generator.

3. Identify problems RAG solves

Discuss how RAG mitigates issues like outdated knowledge, hallucination, and lack of domain-specific expertise. Highlight that it enables dynamic knowledge updates without retraining.

4. Discuss engineering trade-offs

Explain trade-offs such as retrieval latency vs. accuracy, index size vs. recall, and generation quality vs. computational cost. Relate to system design decisions.

5. Conclude with evaluation and iteration

Mention how to evaluate RAG systems (e.g., retrieval metrics, answer faithfulness) and iterate on components. Emphasize that RAG is a system that requires tuning.

Key Points to Mention

  • Retrieval methods: dense (e.g., embeddings) vs. sparse (e.g., BM25) and hybrid approaches
  • Indexing strategies: vector databases, approximate nearest neighbor search, and chunking
  • Generation conditioning: how retrieved passages are incorporated into the prompt
  • Problems solved: knowledge cutoff, hallucination reduction, domain adaptation, and cost-effective updates
  • Trade-offs: latency, cost, scalability, and accuracy
  • Evaluation metrics: retrieval recall/precision, answer faithfulness, and end-to-end task performance

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

Q5

Walk me through how LLM agent architectures are structured and what the key design considerations are.

System DesignTechnical Trade-offs
Author's notes

Talked about the planning loop, tool use, memory, and how the model acts as a controller that calls external functions.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining an LLM agent as a system that uses an LLM for reasoning and decision-making, then describe the core components (model, tools, memory, planner) and how they interact. Finally, discuss key design considerations such as trade-offs between autonomy and control, latency vs. accuracy, and cost management, tying them to real-world constraints like those at Amazon.

Pro tip: Emphasize how you would measure and iterate on agent performance using metrics like task success rate and cost per task, and mention Amazon's leadership principles like Customer Obsession and Invent and Simplify to show cultural alignment.

1. Define the agent architecture

Explain that an LLM agent typically consists of a core LLM, a set of tools/APIs, a memory module, and a planner/executor loop. Describe how these components work together to perceive, reason, and act.

2. Describe the control flow

Walk through the typical loop: the LLM receives input, decides on an action (e.g., call a tool), observes the result, and iterates until a stopping condition. Mention variations like ReAct, Plan-and-Execute, and multi-agent systems.

3. Highlight key design considerations

Discuss trade-offs: autonomy vs. reliability, latency vs. accuracy, cost vs. performance, and safety/guardrails. Explain how these influence architectural choices.

4. Connect to Amazon context

Relate the design to Amazon's scale, customer obsession, and operational excellence. For example, how would you ensure low latency for customer-facing agents or manage costs at scale?

5. Summarize with evaluation and iteration

Conclude by emphasizing the importance of metrics, logging, and continuous improvement. Mention A/B testing, offline evaluation, and human-in-the-loop feedback.

Key Points to Mention

  • Core components: LLM, tools, memory, planner/executor
  • Common patterns: ReAct, Plan-and-Execute, multi-agent collaboration
  • Trade-offs: autonomy vs. control, latency vs. accuracy, cost vs. performance
  • Safety and guardrails: prompt injection, output validation, fallback mechanisms
  • Evaluation metrics: task success rate, cost per task, latency, user satisfaction
  • Scalability and operational concerns: caching, rate limiting, monitoring

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