amazon logo
Amazon· SDE Intern

Amazon OA problems SDE Intern (India) - July 2025

Location
India
Posted
5 Jul 2025
391 reads

Summary

I successfully solved two coding problems during my Amazon SDE Intern Online Assessment for July 2025, which also included behavioral and aptitude questions.

How it went

Problem 1

You are given an array sequenceData of length n, where each element is a positive integer.

You can perform the following operation any number of times (including zero):

Choose a prefix of the array (the first s elements where 1 ≤ s ≤ n) that contains no zeros, and Decrease every element in that prefix by 1.

Your task is to perform any sequence of such operations to maximize the number of zeros in the array.

Return the maximum number of zeros that can be achieved.


Problem 2

You are given an array items of length n, where items[i] represents the number of items in the i-th storage bin.

You can perform the following operation any number of times:

Choose the bin with the maximum number of items (if multiple, pick any), Remove 1 item from it and add it to the bin with the minimum number of items (if multiple, pick any).

Your goal is to perform such operations until the difference between any two bins is at most 1.

Return the minimum number of operations required to achieve this balanced state.


SOLVED both of them

The test also included lot of behavorial and aptitiude based questions.

Questions asked (2)

  1. 01

    Maximize Zeros in Array by Prefix Decrement

    Data Structures & Algorithms

    You are given an array sequenceData of length n, where each element is a positive integer.

    You can perform the following operation any number of times (including zero):

    Choose a prefix of the array (the first s elements where 1 ≤ s ≤ n) that contains no zeros, and Decrease every element in that prefix by 1.

    Your task is to perform any sequence of such operations to maximize the number of zeros in the array.

    Return the maximum number of zeros that can be achieved.

  2. 02

    Balance Storage Bins with Minimum Operations

    Data Structures & Algorithms

    You are given an array items of length n, where items[i] represents the number of items in the i-th storage bin.

    You can perform the following operation any number of times:

    Choose the bin with the maximum number of items (if multiple, pick any), Remove 1 item from it and add it to the bin with the minimum number of items (if multiple, pick any).

    Your goal is to perform such operations until the difference between any two bins is at most 1.

    Return the minimum number of operations required to achieve this balanced state.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!