← Amazon Interview Insights

Amazon·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jun 2026

Summary

Amazon SWE coding screen, one main problem with two follow-ups that escalated pretty fast. The core question was easy enough but the follow-ups pushed into territory I wasn't fully prepared for.

Questions Asked (3)

Q1

Given a list of integers, print every odd number in the list.

Algorithms & Data Structures
Author's notes

Fine, wrote the loop, checked modulo, done in two minutes.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: confirm input format, output expectations, and edge cases. Then propose a simple linear scan solution, discussing time and space complexity. If appropriate, mention alternative approaches like list comprehensions or streams, but prioritize clarity and efficiency.

Pro tip: Demonstrate awareness of production concerns: ask if the list can be large and if memory is a constraint, then suggest a generator or streaming approach to handle large datasets efficiently.

1. Clarify requirements

Ask about input size, data types, output format (e.g., print each on new line or as a list), and whether the list can be empty or contain negative numbers.

2. Outline approach

Propose iterating through the list and checking each number's parity. Explain that you'll print odd numbers as you encounter them.

3. Discuss complexity

State that the solution is O(n) time and O(1) extra space (excluding output), which is optimal for this problem.

4. Consider alternatives

Mention other ways to implement, such as list comprehensions or filter functions, and note trade-offs (e.g., memory usage if creating a new list).

5. Handle edge cases

Address empty list, all even numbers, and negative odd numbers (e.g., -3 is odd). Confirm that the solution handles these correctly.

Key Points to Mention

  • Time complexity: O(n) single pass
  • Space complexity: O(1) extra space if printing directly
  • Modulo operator for parity check: num % 2 != 0
  • Edge cases: empty list, negative numbers, all evens
  • Alternative implementations: list comprehension, filter, generator
  • Scalability: generator for large datasets to avoid memory overhead

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

Q2

Does your solution correctly handle negative numbers? For example, is -3 considered odd?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I said yes without thinking and the interviewer just waited.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Acknowledge that the modulo operator's behavior with negative numbers varies by language, so the solution must be explicit. Then explain how you would test and ensure correctness, such as using Math.abs or checking remainder != 0, and discuss trade-offs like performance and readability.

Pro tip: Mention that in languages like Python, -3 % 2 yields 1, while in Java it yields -1, so relying on n % 2 == 1 is a common bug. Show you're aware of these pitfalls and how to write portable code.

1. Clarify the definition of odd

State that an integer is odd if it is not divisible by 2, i.e., n % 2 != 0. This definition holds for negative numbers.

2. Identify language-specific behavior

Explain that the modulo operator can return negative results in some languages (e.g., Java, C++), so checking n % 2 == 1 fails for negative odd numbers.

3. Propose a robust solution

Suggest using n % 2 != 0 or Math.abs(n % 2) == 1, and note that bitwise AND (n & 1) works for two's complement integers but may not be portable.

4. Discuss trade-offs

Compare readability, performance, and portability of different approaches, and mention that the choice depends on language and context.

5. Test with edge cases

Emphasize testing with negative numbers, zero, and extreme values to ensure correctness.

Key Points to Mention

  • Definition of odd: n % 2 != 0
  • Language-specific modulo behavior (e.g., Python vs. Java)
  • Common bug: using n % 2 == 1 for negative numbers
  • Alternative: Math.abs(n % 2) == 1 or (n & 1) == 1
  • Trade-offs: readability, performance, portability
  • Testing edge cases: negative numbers, zero, Integer.MIN_VALUE

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

Q3

How would you handle integers that are too large to fit in 64 bits, such as arbitrary-precision numbers represented as strings?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Did not see this coming.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: we need to perform arithmetic on numbers represented as strings, likely for operations like addition or multiplication. Then, outline a digit-by-digit algorithm that simulates manual arithmetic, handling carries and signs, and discuss trade-offs between different approaches. Finally, mention edge cases and potential optimizations.

Pro tip: Emphasize that you would first check if a built-in arbitrary-precision library (like BigInteger in Java or Python's int) is available, but be prepared to implement it manually if the interview requires it. This shows practical awareness and depth.

1. Clarify requirements and constraints

Ask about the specific operations needed (addition, subtraction, multiplication, division), input format (strings, possibly with signs), and performance expectations. This ensures you address the right problem.

2. Choose an algorithm

For addition/subtraction, use digit-by-digit processing from least significant digit, managing carries/borrows. For multiplication, consider grade-school algorithm or Karatsuba for large numbers. Discuss trade-offs.

3. Handle signs and edge cases

Account for negative numbers, leading zeros, empty strings, and invalid input. Normalize inputs by stripping leading zeros and determining sign.

4. Implement and test

Write clean code with helper functions for digit conversion and carry handling. Test with cases like '0', '999+1', large numbers, and negative results.

5. Analyze complexity and optimizations

State time and space complexity (O(n) for addition, O(n*m) for multiplication). Mention optimizations like chunking digits or using FFT for very large numbers if relevant.

Key Points to Mention

  • Digit-by-digit simulation of manual arithmetic
  • Carry and borrow propagation
  • Sign handling and normalization (e.g., stripping leading zeros)
  • Time and space complexity analysis
  • Trade-offs between custom implementation and built-in libraries
  • Edge cases: empty strings, leading zeros, negative results, overflow in intermediate steps

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