← Amazon Interview Insights

Amazon·Software Engineer·Online Assessment (OA)·Intermediate

IntermediatePrefer not to say
Apr 2026Remote

Summary

Amazon SWE online assessment, second part of the OA, where you get a buggy full-stack repo and an in-browser AI assistant and have 60 minutes to reproduce failures, find the broken code, and get the test suite green. No whiteboard algorithms, just a tight engineering loop under a clock.

Questions Asked (9)

Q1

Given a buggy full-stack repo (e.g. a loan system where users can't create or view loans, or can fund with insufficient balance), reproduce the failures, locate the broken modules, and patch them so the test suite passes within 60 minutes.

Root Cause AnalysisAPI & IntegrationsTechnical Trade-offs
Author's notes

The loan scenario is probably the most common one people run into.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by running the test suite to see the failures, then trace each failure to the relevant module using logs and code inspection. Prioritize fixes by impact and complexity, and verify each fix with targeted tests before running the full suite. Communicate your debugging process clearly, emphasizing root cause analysis and trade-offs.

Pro tip: Before diving into code, quickly scan the repo structure and README to understand the architecture and data flow; this often reveals common pitfalls like missing validation or incorrect API contracts. Also, use git bisect or recent commits to identify when bugs were introduced.

1. Reproduce and Prioritize Failures

Run the test suite to identify all failing tests. Group failures by module and prioritize based on severity and dependencies (e.g., loan creation blocking other features).

2. Trace and Isolate Root Causes

For each failure, use logs, breakpoints, and code inspection to trace the error to its source. Check both frontend and backend, and verify API contracts and data validation.

3. Patch and Verify Incrementally

Fix one issue at a time, starting with the most critical. After each fix, run the relevant tests to ensure the fix works and doesn't break other functionality.

4. Run Full Suite and Refactor if Needed

Once all targeted tests pass, run the entire suite to catch regressions. If time permits, refactor for clarity or performance, but avoid over-engineering.

Key Points to Mention

  • Root cause analysis: distinguish between symptoms and underlying causes (e.g., insufficient balance check missing vs. incorrect API response).
  • API and integration issues: verify request/response schemas, status codes, and error handling between frontend and backend.
  • Technical trade-offs: balancing speed vs. thoroughness, fixing critical path first, and avoiding scope creep.
  • Testing strategy: use unit tests for isolated logic, integration tests for API endpoints, and end-to-end tests for user flows.
  • Debugging tools: leverage logging, debuggers, and version control (git bisect) to efficiently locate bugs.
  • Communication: explain your thought process, ask clarifying questions if needed, and summarize fixes and their impact.

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

Q2

Fix a broken password reset flow: the verification code is never generated, the 30-second expiry isn't enforced, and the new password isn't persisted to the user profile. There's also a separate test URL file with undefined variables that breaks the test runner before you even start.

Root Cause AnalysisAPI & IntegrationsSystem Design
Author's notes

The undefined variables in the test file genuinely threw me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by fixing the test runner by resolving undefined variables in the test URL file, then systematically debug each broken component of the password reset flow: code generation, expiry enforcement, and password persistence. For each issue, identify the root cause, implement a fix, and verify with tests, while considering edge cases and system design implications.

Pro tip: Demonstrate a test-driven approach by writing or fixing tests first to reproduce the bugs, then implement fixes and ensure all tests pass. Also, mention the importance of logging and monitoring to catch such issues in production.

1. Fix the test environment

Resolve undefined variables in the test URL file to ensure the test runner can execute. This allows you to run tests and validate fixes for the password reset flow.

2. Diagnose code generation failure

Investigate why the verification code is never generated. Check the code generation logic, dependencies, and any error handling that might silently fail.

3. Enforce 30-second expiry

Examine the expiry logic: ensure timestamps are set correctly when codes are generated and validated against the current time. Consider clock skew and timezone issues.

4. Persist new password

Trace the password update flow to identify why the new password isn't saved. Check database transactions, ORM mappings, and error handling during persistence.

5. Verify and harden

Run tests to confirm all fixes, add edge case tests (e.g., expired code, invalid code), and review for security best practices like rate limiting and secure code storage.

Key Points to Mention

  • Root cause analysis: using logs, debuggers, and unit tests to pinpoint failures
  • Test-driven development: fixing tests first to reproduce and validate fixes
  • Time handling: using UTC timestamps and server-side validation for expiry
  • Database persistence: ensuring transactions commit and handling errors
  • Security considerations: hashing codes, rate limiting, and avoiding information leakage
  • System design: decoupling components for testability and maintainability

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

Q3

Implement rate limiting and a keyword/user blocklist on top of an existing repo as a full-stack feature addition.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This one's less about debugging and more about knowing where middleware lives in whatever stack they give you.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a layered architecture that separates rate limiting and blocklist concerns from core business logic. Walk through the design from data model to API enforcement, highlighting trade-offs and operational considerations. Conclude with a rollout and monitoring plan.

Pro tip: Emphasize idempotency and graceful degradation: rate limiting and blocklists should fail open or closed based on business impact, and you should discuss how to avoid blocking legitimate users during false positives.

1. Clarify Requirements and Constraints

Ask about scale, latency budgets, existing tech stack, and whether the blocklist is global or per-tenant. Confirm if rate limiting is per user, IP, or API key, and the desired enforcement point (gateway, middleware, service).

2. Design Data Model and Storage

Choose appropriate storage for counters (e.g., Redis for rate limiting) and blocklist (e.g., database with caching). Discuss TTLs, eviction policies, and how to handle distributed consistency.

3. Define Enforcement Logic and Integration

Describe where to intercept requests (e.g., API gateway, middleware) and how to apply rules without duplicating code. Cover algorithms like token bucket or sliding window for rate limiting, and exact-match or regex for blocklist.

4. Address Trade-offs and Edge Cases

Discuss trade-offs between accuracy and performance, e.g., approximate vs. exact counting, and how to handle race conditions. Cover failure modes: what happens if Redis is down? How to avoid blocking legitimate traffic?

5. Plan Rollout, Monitoring, and Iteration

Propose a phased rollout with feature flags, metrics (e.g., block rate, false positives), and alerting. Include a feedback loop to tune thresholds and update blocklists.

Key Points to Mention

  • Choice of rate limiting algorithm (token bucket, leaky bucket, fixed/sliding window) and its implications
  • Storage and consistency: using Redis with atomic operations (e.g., INCR, Lua scripts) for distributed rate limiting
  • Blocklist management: data sources, update frequency, caching strategy, and avoiding stale data
  • Performance impact: minimizing added latency, using in-memory caches, and asynchronous logging
  • Failure handling: fail-open vs. fail-closed, circuit breakers, and fallback mechanisms
  • Observability: metrics, logging, and tracing to monitor effectiveness and debug issues

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

Q4

Debug a return-system fraud scoring service where six numeric thresholds and weighting values are intentionally seeded with wrong values across the scoring path.

Root Cause AnalysisAlgorithms & Data StructuresRoot Cause Analysis
Author's notes

Six bugs across one scoring function sounds manageable until you realize the bugs compound each other.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the expected behavior and identifying all inputs and outputs of the scoring service. Then systematically trace the scoring path, comparing each threshold and weight against the intended values, and use logging or unit tests to pinpoint discrepancies. Finally, propose a fix and a validation strategy to prevent similar issues.

Pro tip: Demonstrate a methodical approach by first reproducing the issue with a minimal test case, then use binary search or divide-and-conquer to isolate the faulty component. This shows efficiency and strong debugging skills.

1. Understand the System

Review the scoring service architecture, including inputs, outputs, and the role of each threshold and weight. Clarify the expected behavior and success criteria.

2. Reproduce the Issue

Create a minimal test case that triggers the incorrect scoring. Capture the actual output and compare it with the expected output to confirm the bug.

3. Isolate the Fault

Trace the scoring path step by step, checking each threshold and weight. Use logging, breakpoints, or unit tests to identify which values are incorrect.

4. Fix and Validate

Correct the wrong values, then re-run tests to ensure the scoring matches expectations. Add regression tests to prevent future occurrences.

5. Prevent Recurrence

Suggest improvements such as configuration validation, automated tests for thresholds, or monitoring to catch similar issues early.

Key Points to Mention

  • Systematic debugging approach: reproduce, isolate, fix, validate.
  • Importance of understanding the scoring algorithm and business rules.
  • Use of unit tests and logging to pinpoint incorrect values.
  • Consideration of edge cases and data validation.
  • Proactive measures like configuration checks and regression tests.
  • Clear communication of findings and proposed solutions.

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

Q5

Pick one of four backend frameworks (including Django and Spring Boot) before entering the assessment, then fix two seeded bugs in a small CRUD service so the bundled tests pass. You cannot switch frameworks once you've chosen.

Technical Trade-offsAPI & IntegrationsRoot Cause Analysis
Author's notes

The framework lock-in is real and a little stressful.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Choose the framework you know best to minimize cognitive load, then systematically reproduce the failing tests, trace the bugs to their root causes, and fix them with minimal changes. Verify by running the full test suite and consider edge cases to ensure robustness.

Pro tip: Before fixing anything, read the test code to understand expected behavior and use the debugger or logging to pinpoint the exact failure points—this saves time and prevents guesswork.

1. Select Framework Strategically

Pick the framework you are most proficient in, considering your familiarity with its conventions, debugging tools, and testing setup. Avoid choosing based on popularity alone.

2. Run Tests and Reproduce Failures

Execute the bundled tests to see which ones fail and capture the error messages. This gives you a clear starting point and confirms the bugs.

3. Analyze and Locate Bugs

Inspect the failing test cases and trace the code paths to identify the root causes. Use debugging tools, logs, or breakpoints to understand the incorrect behavior.

4. Implement Minimal Fixes

Apply targeted changes to correct the bugs without introducing unnecessary modifications. Ensure the fixes align with the framework's best practices.

5. Verify and Validate

Re-run the tests to confirm all pass. Additionally, consider edge cases or write quick sanity checks to ensure the fixes are robust and don't break other functionality.

Key Points to Mention

  • Framework selection based on personal expertise and debugging efficiency
  • Systematic debugging approach: reproduce, isolate, fix, verify
  • Importance of reading test cases to understand expected behavior
  • Minimal and targeted code changes to avoid regressions
  • Use of framework-specific tools (e.g., Django debug toolbar, Spring Boot Actuator) for diagnosis
  • Time management: prioritize fixing critical bugs first and avoid over-engineering

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

Q6

Fix a Jira-like comment platform where creating and updating comments doesn't persist or display correctly. The fix must also correctly return 401/403 with specific messages for unauthenticated or unauthorized requests.

API & IntegrationsRoot Cause AnalysisSystem Design
Author's notes

Classic 'object never written back' bug.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by systematically reproducing the issue to isolate whether it's a frontend, backend, or database problem, then trace the request flow from API endpoint to persistence layer. Address the 401/403 handling by verifying authentication middleware and authorization checks, ensuring correct status codes and messages are returned. Finally, propose a fix with tests to prevent regression.

Pro tip: Demonstrate a bias for action by outlining immediate debugging steps (e.g., checking logs, using curl) while also considering long-term improvements like adding integration tests for auth scenarios. This shows you can balance urgency with quality, a key Amazon leadership principle.

1. Reproduce and Isolate

Reproduce the issue consistently and determine if it's frontend (display), backend (persistence), or both. Check network requests, server logs, and database entries to narrow down the failure point.

2. Trace the Request Flow

Follow the request from the API endpoint through authentication, authorization, business logic, and database operations. Identify where the comment creation/update fails or where incorrect status codes are returned.

3. Fix Persistence and Display

Correct the backend logic to properly save comments (e.g., missing database commit, incorrect query) and ensure the frontend correctly fetches and renders updated comments (e.g., cache invalidation, state update).

4. Implement Correct Auth Responses

Ensure authentication middleware returns 401 for unauthenticated requests and authorization checks return 403 for unauthorized users, with clear, specific error messages. Verify these are consistently applied across all comment endpoints.

5. Test and Prevent Regression

Write unit and integration tests covering comment CRUD operations and auth scenarios. Add logging and monitoring to catch similar issues early.

Key Points to Mention

  • Reproduce the issue and use debugging tools (logs, network tab, database queries) to isolate the root cause.
  • Check for common persistence issues: missing database commits, incorrect ORM mappings, or transaction rollbacks.
  • Verify frontend state management and cache invalidation to ensure comments display after creation/update.
  • Differentiate between 401 (unauthenticated) and 403 (unauthorized) and ensure middleware returns correct status codes and messages.
  • Write tests for both happy path and auth failure scenarios to prevent regressions.
  • Consider edge cases: concurrent updates, input validation, and error handling for database failures.

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

Q7

Add content moderation to a review system: bad-content checks must block submissions with 403, increment a violation counter, set a flagged state after 3 strikes, keep blocking already-flagged users, and record the specific violated words.

API & IntegrationsRoot Cause AnalysisSystem Design
Author's notes

More moving pieces than it looks.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and edge cases, then design a moderation service that integrates with the review submission flow. Focus on the data model for tracking violations and flagged status, and ensure atomicity and idempotency in the checks.

Pro tip: Emphasize that moderation should be a separate service to allow independent scaling and updates, and discuss how to handle false positives and appeals. Also, mention the importance of logging and monitoring for continuous improvement.

1. Clarify Requirements

Ask questions to understand the scope: What defines 'bad content'? How are violated words determined? What is the expected traffic and latency? Are there existing systems to integrate with?

2. Design Data Model

Define how to store user violation counts, flagged status, and records of violated words. Consider using a relational database with a users table and a violations table, or a NoSQL solution for scalability.

3. Implement Moderation Logic

Outline the flow: on review submission, check if user is flagged; if so, block with 403. Otherwise, scan content for bad words; if found, increment violation count, record words, and if count reaches 3, set flagged state. Return 403 on any violation.

4. Ensure Atomicity and Idempotency

Use transactions or atomic operations to update violation counts and flagged status to avoid race conditions. Make the moderation check idempotent to handle retries safely.

5. Discuss Scalability and Monitoring

Talk about scaling the moderation service, caching flagged users, and monitoring for false positives. Suggest logging violations for analysis and potential machine learning improvements.

Key Points to Mention

  • Use of HTTP 403 Forbidden for blocked submissions
  • Atomic increment of violation counter to prevent race conditions
  • Threshold logic: flag after 3 strikes and block subsequent submissions
  • Recording specific violated words for auditing and user feedback
  • Idempotency of the moderation check to handle retries
  • Separation of moderation as a microservice for scalability and maintainability

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

Q8

Fix a movie watchlist service where creating, deleting, and updating lists and adding/removing movies are broken due to missing status codes, missing existence checks, and movies not being saved to the database.

Root Cause AnalysisAPI & IntegrationsData Modeling
Author's notes

Six unit tests, pretty clear failure messages.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by systematically reproducing each broken operation (create, delete, update, add/remove movie) to identify the exact failure points. Then trace the code path for each operation, checking for missing HTTP status codes, absent existence checks, and database persistence issues. Finally, propose and implement fixes, ensuring each operation returns proper status codes, validates resource existence, and correctly saves data to the database.

Pro tip: Demonstrate a test-driven approach by writing unit/integration tests for each operation before fixing, which ensures all edge cases are covered and prevents regressions. Also, mention the importance of consistent error handling and logging for debugging in production.

1. Reproduce and Document Failures

Manually test each operation (create, delete, update list, add/remove movie) to observe the exact errors or incorrect behaviors. Document the expected vs. actual outcomes for each.

2. Trace Code and Identify Root Causes

For each failure, trace the request through the controller, service, and repository layers to pinpoint missing status codes, missing existence checks, or missing database save calls.

3. Implement Fixes with Validation and Persistence

Add appropriate HTTP status codes (e.g., 201 for creation, 204 for deletion, 404 for not found), existence checks before operations, and ensure entities are saved/updated in the database.

4. Write Tests and Verify End-to-End

Create unit and integration tests for each operation to validate fixes and edge cases. Run the full test suite and manually verify the API endpoints.

5. Review and Harden

Review the changes for consistency, add logging for critical operations, and consider potential concurrency or transaction issues to prevent future bugs.

Key Points to Mention

  • Proper HTTP status codes (201 Created, 204 No Content, 404 Not Found, 400 Bad Request)
  • Existence checks before update/delete/add/remove operations to avoid null pointer or silent failures
  • Ensuring database persistence by calling save/update methods and handling transactions
  • Input validation and error handling for robust API behavior
  • Testing strategy: unit tests for service logic, integration tests for API endpoints
  • Logging and monitoring for debugging and production readiness

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

Q9

Track down a single bug hiding the movie recommendations section on a user's home page, with the constraint that the embedded AI assistant can only see the file you currently have open.

Root Cause AnalysisTechnical Trade-offsAPI & Integrations
Author's notes

The AI limitation here actually changes how you work.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scenario: the AI assistant's limited visibility means you must reason about the bug using only the open file, so first identify what that file likely is (e.g., the home page component or recommendation service). Then systematically trace the data flow from that file outward, forming hypotheses about where the recommendation data could be lost or corrupted, and propose targeted diagnostics or fixes that can be validated without seeing other files.

Pro tip: Demonstrate that you can work effectively with incomplete information by explicitly stating your assumptions and how you would verify them, rather than guessing. Also, mention that you would use logging or feature flags to isolate the issue in production without needing to open other files.

1. Clarify the file and its role

Determine what the currently open file is (e.g., frontend component, API handler, service class) and its responsibility in the recommendation flow. This sets the boundaries of what you can directly inspect.

2. Trace the data flow within the file

Follow how recommendation data is fetched, transformed, and rendered in this file. Look for obvious issues like null checks, error handling, or incorrect API calls.

3. Form hypotheses about external dependencies

Based on the file's interactions, hypothesize where the bug might originate outside the file (e.g., API response, database query, caching layer). Prioritize based on likelihood and impact.

4. Propose diagnostics or fixes

Suggest concrete steps to confirm or rule out hypotheses, such as adding logging, writing unit tests, or using feature flags. If a fix is apparent in the file, propose it with justification.

5. Validate and iterate

Explain how you would validate the fix or diagnostic results, and what you would do if the bug persists (e.g., request access to other files, collaborate with teammates).

Key Points to Mention

  • Systematic debugging approach: reproduce, isolate, hypothesize, test
  • Importance of understanding the file's context and dependencies
  • Using logs, metrics, and tracing to gain visibility beyond the open file
  • Considering common failure points: API errors, data serialization, caching, feature flags
  • Trade-offs between quick fixes and root cause analysis
  • Collaboration and communication when information is limited

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