Amazon Software Engineer Interview Experience — Online Assessment Coding Question on Maximizing a Bitwise AND

Amazon·Software Engineer·Sep 2026
Online Assessmenthard

Fresh out of the oven. I found the coding question really confusing. I spent a long time thinking and guessing, and I guessed bitwise AND, which turned out to be wrong. Afterwards I went back over it with Claude, and the approach it gave me was greedy + bit manipulation.

Here is the summary:

Problem:
Given an array Arr, a count K, and a budget C. You can distribute C total "capacity" as increases to any elements (you choose how much to add to which elements, as long as the total added doesn't exceed C). After that, you pick any K elements (not necessarily contiguous) to maximize the bitwise AND of those K values.

Example:
[5, 4, 1, 7, 2], K=3, C=3, output -> 6. Pick 4, 5, 6 -> after allocating they become 6, 6, 7 -> 6 & 6 & 7 -> 6

I went down the wrong path and got it quite badly wrong. I don't know whether I can still pass. Sharing it with everyone.

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
Rounds
Online Assessment
Difficulty
hard
Interview date
Sep 2026
Questions from this interview
1 question

Real Amazon interview experiences

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

All 150 Amazon interview experiences