← American Express Interview Insights

American Express·AI Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

A 20-minute Karat-style debugging round for an AI Engineer role at American Express. The whole thing was about reading test output fast and pinpointing bugs, not writing a ton of code from scratch. Two parts: find and fix a broken function, then write a new one to make extra tests pass.

Questions Asked (2)

Q1

You're given a set of Python classes and a failing test suite. Read the test output, identify which function contains the bug, explain why the tests are failing, and fix the function with a minimal change.

Root Cause AnalysisAlgorithms & Data Structures
Author's notes

The pressure here isn't writing code, it's reading test failure messages and being precise about what's actually broken.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by carefully reading the test output to identify which test cases are failing and the specific assertion errors. Then trace the failing tests back to the relevant function(s) in the code, using debugging or print statements to isolate the bug. Once identified, explain the root cause and propose a minimal fix that makes the tests pass without breaking other functionality.

Pro tip: Demonstrate a systematic debugging process: verbalize your hypotheses and how you validate them, rather than jumping to a fix. This shows interviewers your problem-solving maturity and reduces the risk of overlooking edge cases.

1. Analyze test output

Read the test failures to understand which tests fail, the expected vs. actual results, and any error messages or stack traces. This narrows down the problematic area.

2. Locate the buggy function

Map the failing tests to the functions they exercise. Use the stack trace or test names to identify the specific function containing the bug.

3. Diagnose the root cause

Examine the function's logic, inputs, and outputs. Compare with expected behavior from tests to pinpoint the exact line or condition causing the failure.

4. Propose a minimal fix

Make the smallest change that corrects the bug, such as adjusting a condition, fixing an off-by-one error, or correcting a variable name. Avoid refactoring unless necessary.

5. Verify and explain

Run the tests to confirm the fix works and no new failures occur. Explain why the fix resolves the issue and how it addresses the root cause.

Key Points to Mention

  • Reading and interpreting test output, including assertion errors and stack traces
  • Using debugging techniques like print statements or a debugger to trace execution
  • Understanding the function's intended behavior from docstrings, comments, or test cases
  • Identifying common bug types: off-by-one errors, incorrect conditionals, type mismatches, or variable scope issues
  • Making minimal changes to avoid unintended side effects
  • Running the full test suite after the fix to ensure no regressions

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

Q2

Based on a short spec, write a new function so that a set of additional tests passes.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Straightforward once the first part was done.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, carefully read the spec and the failing tests to understand the exact expected behavior, including edge cases. Then, design a function that satisfies the spec while considering algorithmic efficiency and trade-offs. Finally, implement, test, and iterate until all tests pass, explaining your reasoning throughout.

Pro tip: Before writing code, restate the spec in your own words and confirm your understanding with the interviewer. This shows clarity and prevents misinterpretation.

1. Clarify Requirements

Read the spec and tests carefully. Ask clarifying questions about ambiguous points, input constraints, and expected outputs.

2. Plan the Approach

Outline the algorithm, choose appropriate data structures, and consider time/space complexity. Discuss trade-offs if multiple solutions exist.

3. Implement the Function

Write clean, modular code with meaningful variable names. Handle edge cases explicitly.

4. Test and Debug

Run the provided tests and additional edge cases. If failures occur, debug systematically by tracing through the logic.

5. Review and Optimize

Refactor for readability and efficiency. Discuss potential improvements or alternative approaches.

Key Points to Mention

  • Understanding the spec and test cases thoroughly
  • Choosing appropriate data structures and algorithms
  • Analyzing time and space complexity
  • Handling edge cases and input validation
  • Writing clean, maintainable code
  • Communicating trade-offs and design decisions

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