Amazon SDE-1 Intern OA Experience🫪
- Posted
- 25 Oct 2026
Summary
I completed an online assessment for an SDE-1 intern role, consisting of a binary string problem, a repository-based debugging task, and situational judgement questions.
How it went
I recently appeared for an Amazon SDE-I Intern OA, and I wanted to share my experience, especially the coding sections, because the second question was quite different from a typical LeetCode problem.
Q1 - Binary String Problem
The first question was easy based on a binary string log and an integer k.
We can choose one substring of length k and change every 0 inside that substring to 1.
The goal is to find the maximum number of consecutive 1s possible after the operation.
Example
log = "11001"
k = 2
11[00]1
↓
11[11]1
Result = "11111"
Answer = 5
O(n) Approach
For every possible substring of length k, imagine that we flip that entire window.
Suppose the selected window is:
[ k ]
...1111 [ 0010 ] 111...
↑ ↑
left right
After changing all 0s inside the window to 1, the entire window contributes exactly k consecutive 1s.
Therefore:
answer for this window =
consecutive 1s immediately before the window + k + consecutive 1s immediately after the window
So instead of actually modifying the string for every window, we can precompute:
left[i]= consecutive1s ending at indexiright[i]= consecutive1s starting at indexi
Then for every window [i, i+k-1]:
current = left[i-1] + k + right[i+k]
with proper boundary checks.
This allows us to check every possible window in O(1) after preprocessing.
Complexity
Preprocessing: O(n) Checking all windows: O(n) Time: O(n) Space: O(n)
Q2 - Repository-Based Question
This was where things became much more difficult.
Instead of giving a normal coding problem, Amazon provided an existing repository/codebase.
There were 7+ files, and some individual files had around 400–500+ lines of code.
The task involved understanding an existing return/risk evaluation system.
Some of the logic included:
- Category returnability
- Return-window validation
- Linked-account aggregation
- Return history
- Order-value based scoring
- Risk-score calculation
- Auto-approve / Manual-review / Reject decisions
- Reason mapping
The challenging part wasn't simply writing code.
It was:
Understand the codebase
↓
Understand the existing logic
↓
Run tests
↓
Find why tests fail
↓
Identify the correct component
↓
Modify the implementation
↓
Run tests again
↓
Debug again
There were 6 test cases, and I managed to pass only 2/6.
This question taught me something different from regular DSA.
Code reading + debugging + testing + understanding existing architecture + problem solving.
Q3 - Situational Judgement
The OA also included a Situational Judgement section.
The questions focused more on workplace situations such as:
- Teamwork
- Communication
- Ownership
- Handling disagreements
- Taking feedback
- Decision making
- Customer focus
It felt less like a traditional exam and more like evaluating how you would behave while working in an engineering team.
Overall Experience
For me, the OA was much more than just DSA.
It tested:
DSA
+
Problem Solving
+
Codebase Understanding
+
Debugging
+
Testing
+
Workplace Decision Making
The biggest takeaway for me was the repository-based question.
2/6 tests passed.
Obviously, I would have liked to do much better, but it also showed me exactly what I need to improve:
I need to become better at entering an unfamiliar codebase, understanding existing code quickly, tracing execution, and debugging systematically.
Questions asked (3)
- 01
Maximum Consecutive Ones after Flipping K-length Substring
Data Structures & Algorithms · Medium
Given a binary string
logand an integerk, you may choose one substring of lengthkand change every0inside that substring to1. Return the maximum possible length of consecutive1s after performing this operation.Example
log = "11001" k = 2 Result = 5Approach: Pre‑compute arrays
left[i](consecutive 1s ending at i) andright[i](consecutive 1s starting at i). For each window[i, i+k-1]computeleft[i-1] + k + right[i+k]and take the maximum. This runs in O(n) time and O(n) space. - 02
Repository-Based Return/Risk Evaluation Debugging
Other · Hard
You are given an existing codebase (7+ files, each 400‑500 lines) that implements a return/risk evaluation system. The system includes logic for category returnability, return‑window validation, linked‑account aggregation, return history, order‑value scoring, risk‑score calculation, and decision outcomes (auto‑approve, manual‑review, reject). The task is to understand the code, run the provided tests (6 total), identify why some tests fail, locate the responsible component, modify the implementation, and get the tests to pass.
- 03
Situational Judgement
Behavioral
Answer behavioral scenarios focusing on teamwork, communication, ownership, handling disagreements, taking feedback, decision making, and customer focus. The questions assess how you would behave in an engineering team environment.