Amazon Coding Interview Questions (2026): Patterns, Problems & Prep
The Amazon coding interview questions that actually decide a 2026 loop — how the Online Assessment and the two onsite coding rounds run, the patterns Amazon leans on (two pointers, sliding window, BFS/DFS, graphs, heaps, backtracking and dynamic programming), what the bar raiser probes, and how Leadership Principles surface inside a coding round — plus a two-week prep plan. A how-the-loop-runs guide built around the follow-ups that decide the round, not leaked questions.
October 7, 202615 min read
Amazon Coding Interview Questions: what the 2026 loop really tests
Searching for Amazon coding interview questions usually turns up the same thing: a wall of tagged LeetCode links and no sense of what the room is actually like. That is the opposite of how the loop runs. An Amazon coding round is a timed working session — two problems, a shared editor, and an interviewer who waits for your solution to run and then starts pushing: on the complexity, on the edge cases, and on what happens when the input gets ten thousand times bigger.
This is a map of that loop for 2026 — the stages from the amazon online assessment through the onsite, the handful of coding interview patterns that account for most of the questions, and the follow-ups that decide whether a working answer becomes an offer. It is framed the way the screen is framed: not "here are the exact questions" but "here is the pattern, here is the kind of problem it shows up in, and here is the probe that separates a passing answer from a memorised one." Read it as a prep plan, because the code is table stakes — the round is won on what you say when someone asks "why that, and not the other thing?"
How the Amazon coding loop runs (2026)
Amazon's process is not one interview; it is a loop of four to six, and coding shows up in more than one of them. A typical path for a software engineer is an online assessment first, then a phone screen, then an onsite of several back-to-back rounds — a mix of coding, system design, and Leadership Principles — with one specially-trained interviewer, the bar raiser, sitting in as an independent evaluator. The coding questions lean medium difficulty, occasionally hard, and the quiet signal the interviewer is reading is how quickly and cleanly you get to the optimal answer.
On a live round the interviewer rarely waits for a perfect solution before pushing. "Your solution works. Now the array is a hundred million elements. What breaks first?" That question — scale, memory, the cost of your data structure — is the one a copied solution can never rehearse, and the one these rounds are really testing.
The rounds below are modelled on how the Amazon loop runs, not scraped from any candidate's recall. What matters for prep is the shape: two problems per round, a clock, real code that compiles and runs, and a follow-up after every submission.
Inside the Online Assessment (90 minutes)
The amazon oa questions are the gate most candidates hit first. In the modelled version of this round you get 90 minutes and two problems, auto-graded against visible and hidden test cases, so correctness is checked the same way the real assessment checks it — your code has to actually pass, not just look right. The two problems usually sit in the medium band: a graph traversal, a dynamic-programming count, a matrix problem. Pacing is the hidden skill — a single problem you cannot finish is worse than two you solve at eighty percent, so budget the clock and get something running early.
The onsite coding rounds (60 minutes each)
The onsite coding rounds run 60 minutes apiece, two of them, and they climb in difficulty — the second is where the hard problems live. Here the interviewer is in the room (by voice), so the performance is half the grade: you narrate the plan before you type, you handle the edge cases out loud, and you answer the follow-ups one at a time. The same problem that is a clean pass in silence can fail here if you cannot explain why your approach is correct and what it costs.
The coding patterns Amazon tests
You do not need five hundred problems; you need the dozen coding interview patterns that account for most of them, and the judgment to recognise which one a new prompt is wearing. These are the same leetcode patterns every FAANG screen reuses, but Amazon leans hard on graphs, trees, and dynamic programming, and it always circles back to complexity. The table is the shortlist: the pattern, the kind of problem it shows up in, and the follow-up that decides the round.
| Pattern | Example problem type | The follow-up that decides it |
|---|---|---|
| Two pointers / fast-slow | Pair in a sorted array, dedupe in place, detect a cycle | "Why two pointers and not a hash set — what did that buy you?" |
| Sliding window | Longest substring without repeats, minimum window | "When does the window shrink, and how do you know you never miss a candidate?" |
| Hashing | Two-sum, group anagrams, first unique character | "What's your key, and what happens to the cost on a collision?" |
| Trees (BFS / DFS) | Level-order, right side view, max path sum | "Recursion or a queue — what's the stack depth on a skewed tree?" |
| Graphs (BFS / DFS, topological sort) | Number of islands, course schedule, pacific atlantic | "Is there a cycle, and how would your code detect it?" |
| Heaps / top-K | K closest points, merge k sorted lists, task scheduler | "Why a heap and not a full sort — what's the cost difference?" |
| Backtracking | Word search, combination sum, generate parentheses | "Where do you prune, and what's the worst-case branching factor?" |
| Dynamic programming | Unique paths, word break, house robber, edit distance | "What's the state, and can you drop a dimension to save memory?" |
Two pointers, sliding window and hashing (the warm-ups)
These open many screens because they are fast to pose and reveal a lot. The two pointer technique turns an O(n²) scan of a sorted array into one linear pass; the sliding window technique does the same for "longest / shortest / count of" substring and subarray questions. The trap is never the syntax — it is proving the window is correct: say out loud when it grows, when it shrinks, and why the best answer is always inside it.
# Sliding window skeleton: grow on the right, shrink on the left when invalid
left = 0
for right in range(len(s)):
add(s[right])
while invalid(): # a rule broke — pull the left edge in
remove(s[left]); left += 1
best = max(best, right - left + 1)
Hashing is the other warm-up: a dictionary turns a repeated lookup into O(1), which is why two-sum and group-anagrams are openers. The follow-up is always the hidden cost — "what is your key, and what is the memory at a billion rows?" — so name the space tradeoff before you are asked.
Trees, graphs and BFS/DFS (the core)
If one family decides an Amazon onsite, it is this one. Breadth-first search for level-order and shortest-path-in-an-unweighted-graph; depth-first search for path sums, island counting, and connectivity. Have the breadth-first template automatic, because half the tree and grid questions are a variation on it.
from collections import deque
def level_order(root):
if not root:
return []
q, out = deque([root]), []
while q:
level = []
for _ in range(len(q)): # one full level at a time
node = q.popleft()
level.append(node.val)
if node.left: q.append(node.left)
if node.right: q.append(node.right)
out.append(level)
return out
Graphs add one more move: topological sort for ordering problems like course schedule, where the real question hiding inside is "is there a cycle?" Narrate the cycle check — a node left with non-zero in-degree, or a grey node seen twice in a DFS — and you have answered the follow-up before it lands.
Heaps, backtracking and dynamic programming (the senior signal)
These are where a mid-to-senior loop is won. A heap keeps the top-K without sorting everything — O(n log k) instead of O(n log n) — which is the entire point of k-closest-points and merge-k-lists.
import heapq
# Top-K: keep a heap of size k, evict the smallest — O(n log k), not O(n log n)
heap = []
for x in items:
heapq.heappush(heap, (score(x), x))
if len(heap) > k:
heapq.heappop(heap)
Backtracking (word search, combination sum) is judged on where you prune — an interviewer wants to hear the condition that stops a dead branch early. And dynamic programming interview questions — unique paths, word break, edit distance, house robber — are judged on two sentences: what is the state, and what is the transition. Say those cleanly and the code writes itself; fumble them and no amount of code recovers it. The last probe is almost always memory: "can you drop the 2-D table to a single row?"
What the bar raiser probes
Every Amazon onsite includes a bar raiser — a senior interviewer, deliberately from outside the hiring team, trained to hold a consistent bar and act as an independent check on the decision. In a coding round they are the source of the hardest follow-ups: not "does it run?" but "prove the complexity," "what breaks at scale," "what is the edge case you did not handle." Their job is to find the gap between a solution that works on the sample and an engineer who understands it.
"Your binary search is correct. Walk me through it when the array has duplicates — does it still return the first match?" The bar raiser is not trying to trip you; they are checking whether you can defend the answer, which is exactly what you will do on the job when the code review pushes back.
Treat scale as a reflex, not a surprise. When a solution works, say the complexity unprompted, name the one input that would break it, and offer the fix — a streaming pass, a better data structure, a precomputed index. That is the move that reads as senior.
Leadership Principles inside a coding round
This is the part candidates miss: at Amazon the amazon leadership principles are not quarantined in one behavioral slot. An interviewer can lean on them anywhere, and in the onsite coding rounds they often will — a quick "tell me about a time you had to simplify a design under a deadline" can arrive between problems. Dive Deep, Bias for Action, and Deliver Results map almost directly onto how you work a problem: do you actually understand the mechanism, do you get something running instead of stalling, do you finish on the clock?
The classic amazon leadership principles interview questions follow the same push as the code: "You said you shipped it fast — what did you cut, and what did it cost later?" A STAR answer without numbers falls apart here exactly the way an untested solution does.
If the behavioral push is what unnerves you, drill it the way you drill code — out loud, against follow-ups. Zynter has a dedicated Amazon Leadership Principles deep dive round for exactly that.
How to prepare: a two-week plan
You do not need a hundred new problems in the last fortnight. You need the patterns automatic, the complexity reflexive, and a few answers you can defend while someone interrupts. Here is a realistic two-week pass for coding interview prep.
- Days 1–3: Drill the warm-ups — two pointers, sliding window, hashing — until you recognise them on sight. Write each solution, then say its time and space cost in one sentence.
- Days 4–8: Live in trees and graphs. BFS and DFS templates, topological sort, island counting, path sums. These are the highest-leverage days for an Amazon loop.
- Days 9–11: Heaps, backtracking, and dynamic programming. For each DP problem, say the state and the transition out loud before you code; practise dropping a dimension for memory.
- Days 12–14: Full timed rounds — two problems, clock running, narrating the plan and the complexity, with a Leadership Principles answer between them. The goal is to finish on pace while defending every choice.
The most common mistake in the last week is grinding more problems in silence. By day 12, reading another solution is not the bottleneck — speaking is. If you still want raw volume to drill the problems themselves, PipeCode is a sister platform built for exactly that; use it for reps, then come back here to rehearse defending them out loud.
The follow-ups that decide an Amazon coding round
Scan the right-hand column of the pattern table and the questions rhyme. Master these five cross-cutting follow-ups and you are ready for prompts that are not even on the list.
- "What's the time and space complexity?" → Say it unprompted, the moment your solution runs. Not knowing it is the fastest way to lose a round you technically solved.
- "Now it's a hundred million elements — what breaks first?" → Name the cost (memory, a full sort, a quadratic scan) then the fix (a heap, a stream, an index).
- "Why that data structure?" → Tie it to the access pattern: a hash for O(1) lookup, a heap for top-K, a deque for BFS. The structure is the answer; justify it.
- "What's the edge case you didn't handle?" → Empty input, one element, duplicates, a cycle, integer overflow. Volunteer one before you are asked.
- "Can you prove it's correct?" → Trace two rows by hand, or state the invariant your loop maintains. "Works on the sample" is not a proof.
Each of these maps straight to the four-dimension debrief Amazon's grading mirrors: do you reach the optimal solution (problem solving), narrate it clearly (communication), write code that runs (technical execution), and finish on the clock (time management)? Reading this list teaches you the answers. It does not teach you to deliver them while someone pushes back — that only comes from saying them out loud.
Frequently asked questions
What coding questions does Amazon ask in 2026?
Amazon leans on a dozen recurring patterns — two pointers, sliding window, hashing, trees, graphs with BFS/DFS and topological sort, heaps, backtracking, and dynamic programming — mostly at medium difficulty with a hard problem in the second onsite round. No one can hand you "the actual questions," and you should be wary of anyone who claims to; what you can prepare is the pattern behind each problem type and the follow-ups that decide it. The rounds here are modelled on how the loop runs, not sourced from leaked prompts.
How long is the Amazon Online Assessment, and how many problems?
In the modelled version of the round, the Amazon Online Assessment runs 90 minutes with two problems, auto-graded against visible and hidden test cases. Pacing is the skill most candidates underestimate — getting one problem fully correct and the second most of the way is better than one perfect answer and a blank. Budget the clock, get something running early, then optimise.
Which coding patterns should I focus on for Amazon?
Prioritise trees and graphs (BFS, DFS, topological sort) and dynamic programming — Amazon leans on them harder than most, and they anchor the onsite rounds. Have the warm-ups (two pointers, sliding window, hashing) automatic so they cost you no time, and know heaps and backtracking for the senior-signal questions. Across all of them, be ready to state the time and space complexity the instant your code runs.
Do Amazon coding interviews really test Leadership Principles?
Yes — Amazon weaves Leadership Principles through the whole loop, and the onsite coding rounds are no exception. Expect a short behavioral question between problems, often mapping to Dive Deep, Bias for Action, or Deliver Results. Prepare STAR answers with concrete numbers, because a story without specifics falls apart under the same kind of follow-up the code gets.
How do I practise Amazon coding questions out loud?
Reading a solution is not the same as defending it while someone interrupts. On Zynter, the Coding track runs live voice rounds modelled on the Amazon loop — two problems, a real editor where your code runs against visible and hidden tests, and a voice interviewer that asks the follow-ups above one at a time, then gives you a debrief on problem solving, communication, technical execution, and time management. The score is a practice signal, not a hiring decision.
How long does it take to prepare for an Amazon coding interview?
With focused practice, about two weeks gets you dangerous and four to six weeks comfortable, assuming you already know the basic data structures. Depth beats breadth: fluency in a dozen patterns and the habit of stating complexity out loud beats grinding a hundred problems in silence. Spend the back half of your prep on timed, out-loud mock rounds rather than more reading.
Practise it on Zynter
You can read every pattern. The round is won on the follow-ups.
Pick an Amazon coding round, write code that runs against real test cases, and defend it out loud to a voice interviewer that keeps asking "what's the complexity?" and "what breaks at a hundred million rows?" — then read the debrief. Zynter.ai is on-demand mock interviews modelled on real company loops, with 150+ rounds across 20 companies including Amazon Online Assessment and onsite coding rounds (Sep 2026).
Practise an Amazon coding round → Browse all interview tracksAlmost nobody freezes on the code. They freeze on the follow-up.
Answer a real round to a voice interviewer that keeps asking why. No scheduling, no subscription, first session ready in under a minute.
Keep reading
All posts
Behavioral Interview Questions and Answers: Top 25 with Examples (2026)
The behavioral interview questions that actually repeat in a 2026 software engineering loop — the top 25, grouped, each with what it probes and the follow-up that decides it. Plus the STAR method done right (and where STAR answers fall apart), a strong-vs-weak example, the Amazon Leadership Principles mapped to real questions, and a two-week prep plan. A framework-first guide to answering behavioral questions out loud, under pressure.
Gowtham PotureddiOct 7, 202619 min read

SQL Interview Questions and Answers for Data Engineers (2026)
The SQL interview questions that actually repeat in a 2026 data engineering screen, each with a one-line answer and the follow-up that decides it — joins and aggregation, window functions, deduplication, data modeling and the warehouse — plus the concepts every round drills: SQL vs NoSQL, indexing, and partitioning. A framework-first prep guide for data engineers heading into SQL tech screens.
Gowtham PotureddiOct 6, 202617 min read

System Design Interview Questions: Top 25 Problems with Answers (2026)
The top 25 system design interview questions for 2026, each with a short answer and the one follow-up that decides it — URL shortener, rate limiter, WhatsApp, Netflix, Uber, news feed, web crawler, object storage — plus the core concepts every round drills: consistent hashing, CAP theorem, SQL vs NoSQL, caching, and sharding. A framework-first prep guide for engineers heading into SDE and system design loops.
Gowtham PotureddiOct 5, 202611 min read