← Amazon Interview Insights

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

IntermediatePending
Sep 2026Remote

Summary

Went through the Amazon SDE II pipeline and wanted to share how the OA portion went. Two coding problems plus a SpringBoot project, and then some system design and workplace questions. Got a recruiter callback 20 minutes after submitting, which was either a great sign or just their automated system doing its thing.

Questions Asked (3)

Q1

Given an array of 0s and 1s, return the minimum number of swaps needed to sort it so all 0s come before all 1s.

Algorithms & Data Structures
Author's notes

Easier than I expected for a medium tag.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify that the array contains only 0s and 1s and that we want all 0s before all 1s. Then, count the total number of 0s (or 1s) to determine the target partition, and use a two-pointer or sliding window technique to count misplaced elements, which directly gives the minimum swaps.

Pro tip: Mention that the minimum number of swaps equals the number of 1s in the first k positions (where k is the number of 0s), and that this can be computed in O(n) time and O(1) space. This shows you recognize the optimal solution and can articulate it clearly.

1. Clarify the problem

Confirm that the array contains only 0s and 1s, and that the goal is to sort it so all 0s come before all 1s. Ask if the array can be modified in-place or if a new array is needed.

2. Identify the target partition

Count the total number of 0s (or 1s) in the array. This count determines the size of the left partition that should contain all 0s.

3. Count misplaced elements

Using a sliding window of size equal to the number of 0s, count how many 1s are in that window. Each 1 in the window is misplaced and needs to be swapped with a 0 outside the window.

4. Compute minimum swaps

The minimum number of swaps is exactly the number of 1s in the window (or equivalently, the number of 0s outside the window). Return that count.

5. Analyze complexity

State that the algorithm runs in O(n) time with a single pass to count zeros and another pass to count misplaced ones, and uses O(1) extra space.

Key Points to Mention

  • The array contains only 0s and 1s, so sorting means partitioning.
  • The minimum swaps equal the number of 1s in the first k positions, where k is the total number of 0s.
  • Use a sliding window of size k to count misplaced 1s in one pass.
  • Time complexity is O(n) and space complexity is O(1).
  • Edge cases: all 0s, all 1s, already sorted, empty array.
  • Alternative approach: two-pointer technique to swap misplaced 0s and 1s.

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

Q2

Complete two feature tasks inside a provided SpringBoot application (an IMDb-style project) within the allotted time.

API & IntegrationsTechnical Trade-offs
Author's notes

Finished the whole thing in maybe 10 minutes out of the hour they gave.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by thoroughly understanding the existing SpringBoot application structure and the two feature tasks, then prioritize based on complexity and dependencies. Implement incrementally with tests, ensuring each feature is working before moving to the next, and communicate your progress and trade-offs clearly.

Pro tip: Demonstrate Amazon's Leadership Principles by taking ownership of the tasks, diving deep into the code, and delivering results with high quality. Also, proactively mention how you would handle edge cases and scalability, showing customer obsession.

1. Understand the Requirements and Codebase

Read the task descriptions carefully and explore the existing SpringBoot project structure, including controllers, services, repositories, and models. Identify how the new features integrate with the current architecture.

2. Plan and Prioritize

Break down each feature into smaller sub-tasks, estimate effort, and decide the order of implementation based on dependencies and risk. Consider using a simple checklist to track progress.

3. Implement with Testing

Write code for the first feature, following SpringBoot best practices (e.g., layered architecture, dependency injection). Write unit and integration tests to validate functionality and catch regressions early.

4. Iterate and Refine

After completing the first feature, review and refactor if needed, then move to the second feature. Continuously run tests and ensure the application remains stable.

5. Communicate and Document

Verbally explain your approach, decisions, and any trade-offs made during the process. Document key changes and how to run tests, demonstrating clarity and teamwork.

Key Points to Mention

  • SpringBoot annotations and conventions (e.g., @RestController, @Service, @Repository, @Autowired)
  • RESTful API design principles and proper HTTP status codes
  • Database interaction using Spring Data JPA or JDBC, including entity relationships
  • Unit testing with JUnit and Mockito, and integration testing with @SpringBootTest
  • Handling edge cases such as invalid input, concurrency, and error responses
  • Trade-offs between implementation speed and code quality, and how to prioritize

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

Q3

System design question included as part of the online assessment.

System Design
Author's notes

Not much detail I can share since I don't remember the exact prompt, but it was part of the same OA flow.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem scope and requirements, then outline a high-level design before diving into details. Focus on scalability, reliability, and trade-offs, and be prepared to justify your choices with data and examples.

Pro tip: Amazon values customer obsession and ownership, so tie your design decisions back to customer impact and operational excellence. Also, explicitly discuss how you would measure success and iterate based on metrics.

1. Clarify Requirements

Ask questions to understand functional and non-functional requirements, such as expected scale, latency, consistency, and availability needs. Confirm assumptions with the interviewer.

2. High-Level Design

Sketch the main components (e.g., clients, APIs, services, databases, caches) and how they interact. Keep it abstract and focus on data flow.

3. Deep Dive

Elaborate on critical components: data storage choices, partitioning, replication, load balancing, and caching. Discuss how to handle bottlenecks and failures.

4. Trade-offs and Scalability

Analyze trade-offs (e.g., SQL vs NoSQL, consistency vs availability) and explain how your design scales horizontally. Mention monitoring and metrics.

5. Wrap Up

Summarize the design, reiterate how it meets requirements, and suggest potential improvements or next steps.

Key Points to Mention

  • Scalability: horizontal scaling, sharding, and partitioning strategies.
  • Availability and fault tolerance: replication, failover, and graceful degradation.
  • Data consistency models: eventual vs strong consistency, and their implications.
  • Caching strategies: CDN, application-level caching, and cache invalidation.
  • Monitoring and metrics: how to track performance and detect issues.
  • Cost optimization: balancing performance with infrastructure costs.

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