Amazon New Grad Software Engineer Interview Experience — Binary Swaps and a Django Post Fix

Amazon·Software Engineer·Aug 2026
Online AssessmentNew Gradmedium

I took the online assessment. It had two parts.

  1. DSA: minimum adjacent swaps for a binary array

Given an array containing only 0s and 1s, rearrange it so that all 0s are at one end and all 1s are at the other. Either ordering was allowed: 000...111 or 111...000. In one move, I could swap two adjacent elements. I had to return the minimum number of moves required.

def minMoves(arr):
    pass

For [0, 1, 0, 1], the answer was 1, because one adjacent swap produced [0, 0, 1, 1]. The approximate constraints were 1 <= n <= 100,000 and arr[i] in {0, 1}.

  1. AI coding round: fix Django post creation

A Django and React blogging platform had a backend bug: users completed every required field but could not create and publish a post. I needed to fix this endpoint:

POST /api/posts/
X-User-Id: <user_id>

The request body was:

{
  "title": "string",
  "content": "string",
  "excerpt": "string",
  "category": "string",
  "tags": ["string"],
  "readTime": 5
}

The required behavior was to read fields from request.data; require title, content, and category; generate defaults for optional fields; associate the post with the user from X-User-Id; save it to the database; and return HTTP 201. The response needed the expected JSON structure, including _id and a nested author, and the post needed to appear under My Posts.

The fix had to pass two predefined tests: test_create_post_with_expected_response_structure_and_values and test_save_created_post_to_database.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Amazon
Role
Software Engineer
Level
New Grad
Rounds
Online Assessment
Difficulty
medium
Interview date
Aug 2026
Questions from this interview
2 questions

Real Amazon interview experiences

First-hand reports from Amazon candidates — the rounds, the questions they were asked, and how it went.

All 136 Amazon interview experiences