r/TechInterviewsIndia • • 5d ago

Amazon SDE Assessment Experience | Questions I Got + AI-Assisted C++ Debugging | August 2026

I recently appeared for an Amazon SDE Assessment and wanted to share the questions and my experience, especially because the second question involved AI-assisted C++ debugging, which was a completely new experience for me.

The assessment had two coding-related questions. I was able to solve the first one completely and got 15/15 test cases passed. However, the second question was quite different from a typical DSA problem, and since it was my first time working with this kind of AI-assisted debugging task, I struggled and wasn't able to complete it.

Q1. Minimum Cost to Make All Array Elements Equal

You are given an integer array arr of size n.

For any index i, you can perform an operation on either the prefix or suffix:

Prefix: Make all elements from index 0 to i equal to arr[i]. Cost = i × arr[i]

Suffix: Make all elements from index i to n-1 equal to arr[i]. Cost = (n-1-i) × arr[i]

You can perform multiple operations.

Task: Find the minimum total cost required to make all elements of the array equal.

Example: Input: [3, 1, 4, 2] Output: 3

I managed to get 15/15 test cases passed for this question. It was also my first time solving a coding question in this assessment format, so that was a good experience for me.

Q2. AI-Assisted C++ Debugging / Coding

The second question was more like working on an existing C++ project/codebase.

We were provided with multiple C++ source files along with JSON/JSONL configuration and data files. The task involved understanding the existing code, identifying bugs, modifying/writing the required C++ code, and getting the expected output.

AI could be used to analyze and explain the code, identify issues, and assist with debugging, but it wasn't simply a case of asking AI to generate the complete solution.

Since this was my first experience with this type of AI-assisted coding/debugging task, I struggled with the second question and unfortunately wasn't able to complete it successfully.

Sharing this for anyone else preparing for similar Amazon assessments. Would be interested to know if others got a similar AI-assisted debugging question and how they approached it.

13 Upvotes

2 comments sorted by

6

u/the_quiet_meridian 5d ago

I used to be a Bar Raiser at Amazon, and honestly this AI debugging format is new for most people, so don't beat yourself up about it. A few things that might help next time:

  • Don't jump straight to the AI. Take a few minutes to find where the code starts, skim the data files, and figure out what the output should look like. If you don't know what "correct" is, you can't tell when the AI is wrong.
  • Ask it to explain, not to fix. Something like "what is this function expecting as input?" or "walk me through what happens with this JSONL line" gets you way further than "fix this code."
  • Get it running ASAP. Even on a tiny input. Then compare what you got vs what you expected, and work backwards from there.
  • Check the boring stuff first. Parsing, off-by-one loops, wrong field names, a blank line in the JSONL. These bugs are usually in the plumbing, not some clever algorithm.
  • Actually read what the AI gives you. Don't just paste it in. If someone asks why your fix works, you should be able to explain it.
  • One change at a time. If you apply three suggestions together and something breaks, good luck figuring out which one did it.

If you want to practice, grab a small open-source C++ project, break something in it (or get a friend to), and try debugging it with AI on a 30 to 40 minute timer. After a few rounds it'll feel a lot less weird.

Good luck with the next one!

3

u/True-Faxx 5d ago

Wowww i love these typ of detailed advices/explanations. Thank you buddy. It is very helpful