← Amazon Interview Insights

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

Intermediate
Jun 2026

Summary

Amazon SWE interview with a coding problem around memory size calculation for a graph-based model structure, plus a section where you had to actually use AI prompting and debug the output live. Unusual format compared to what I was expecting.

Questions Asked (2)

Q1

Given a DDN model structure represented as a graph dataset, calculate the total memory size by flattening the graph dimensions and computing size based on the data type's bit size.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

The graph flattening part tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the graph representation and data type, then systematically compute memory by flattening all dimensions and multiplying by the bit size of the data type. Convert bits to bytes and consider any overheads or alignment requirements.

Pro tip: Always state your assumptions about the graph structure and data type, and mention that in real systems, memory alignment and padding can increase the actual footprint beyond the theoretical minimum.

1. Clarify the graph representation

Identify how the DDN model is represented as a graph: number of nodes, edges, and any feature dimensions per node/edge. Confirm if it's stored as an adjacency matrix, edge list, or other format.

2. Determine data type and bit size

Ask or assume the data type used for storing graph elements (e.g., float32, int64) and note its bit size (e.g., 32 bits for float32).

3. Flatten dimensions and compute total elements

Multiply the sizes of all dimensions to get the total number of elements. For example, if the graph has N nodes with D-dimensional features, total elements = N * D.

4. Calculate memory size

Multiply total elements by the bit size of the data type to get total bits, then divide by 8 to convert to bytes (and optionally to KB/MB).

5. Account for overhead and alignment

Mention that actual memory may be larger due to metadata, pointers, or padding for alignment, and discuss trade-offs if relevant.

Key Points to Mention

  • Graph representation (adjacency matrix vs. edge list) and its impact on memory
  • Data type bit size (e.g., float32 = 32 bits, int64 = 64 bits)
  • Flattening dimensions: multiplying all dimension sizes
  • Conversion from bits to bytes (divide by 8)
  • Memory overhead from metadata, pointers, and alignment
  • Scalability considerations for large graphs

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

Q2

Demonstrate how you use AI prompting to solve a coding problem: write the user query, generate code using an AI tool, then debug whatever the AI produces.

Technical Trade-offsAdaptability & Ambiguity
Author's notes

This part was weird.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Walk through a real coding problem you solved using AI, narrating the exact prompt you wrote, the code the AI generated, and the specific bugs you found and fixed. Emphasize how you validated the AI output rather than trusting it blindly, and tie your debugging process to Amazon's Leadership Principles like Customer Obsession and Ownership.

Pro tip: Choose a problem where the AI's first output was subtly wrong—not obviously broken—so you can showcase your debugging depth and judgment. Explicitly state what you would have done differently or how you'd prompt better next time, showing iterative learning.

1. Set the Context and Problem

Briefly describe the coding problem, its constraints, and why you chose to use an AI tool. Keep it concise so you leave time for the prompt, code, and debugging.

2. Show the Exact Prompt

Recite the user query you wrote to the AI, highlighting how you specified inputs, outputs, edge cases, and language/framework. Explain why you phrased it that way.

3. Present the AI-Generated Code

Summarize the code the AI produced, noting any assumptions it made or parts that looked suspicious. Avoid reading every line; focus on the critical sections.

4. Debug and Validate

Walk through the debugging process: how you identified the bug (e.g., test failure, edge case, logic error), the root cause, and the fix you applied. Mention any tests you wrote to verify.

5. Reflect and Generalize

Summarize lessons learned about prompting and debugging AI code, and how you'd apply this to future tasks. Connect to broader engineering principles like code review and testing.

Key Points to Mention

  • Specificity in prompts: including constraints, edge cases, and expected behavior to get better AI output.
  • Critical evaluation of AI-generated code: never trust blindly; always review for logic, security, and performance issues.
  • Debugging methodology: using unit tests, print statements, or debuggers to isolate the issue.
  • Iterative prompting: refining the prompt based on the AI's output to get closer to the solution.
  • Trade-offs: when to use AI vs. writing code manually, considering time, complexity, and risk.
  • Amazon Leadership Principles: Ownership (taking responsibility for the final code), Customer Obsession (ensuring the solution meets user needs), and Learn and Be Curious (improving prompting skills).

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