Amazon SWE 26NG Four Rounds: Dijkstra Delivery Routes + Sliding Window + Top K Orders + Bar Raiser
Amazon SWE 2026 new grad four-round recap: fastest delivery time across a warehouse network with Dijkstra, longest subarray with order total under a threshold (sliding window), real-time top K orders (size-K min-heap), plus project deep dives and Bar Raiser leadership principle follow-ups.
Round 1: Behavioral + graph
Behavioral
Tell me about a time you improved a process with data.
Coding: fastest delivery time
Problem: given Amazon's delivery network, where stations are nodes connected by two-way routes with travel times, find the fastest delivery time from the origin warehouse to a target station.
Approach: Dijkstra's single-source shortest path. Keep a priority queue, repeatedly take the closest node, and relax its neighbors' distances.
import heapq
def shortest_delivery_time(n, roads, src, dst):
"""roads: [(u, v, cost)] undirected edges; returns -1 if unreachable"""
adj = [[] for _ in range(n)]
for u, v, w in roads:
adj[u].append((v, w))
adj[v].append((u, w))
dist = [float("inf")] * n
dist[src] = 0
pq = [(0, src)]
while pq:
d, u = heapq.heappop(pq)
if u == dst:
return d
if d > dist[u]:
continue # stale queue entry
for v, w in adj[u]:
if d + w < dist[v]:
dist[v] = d + w
heapq.heappush(pq, (dist[v], v))
return -1
Time O((V + E) log V).
Discussion points:
- Negative edge weights (Dijkstra doesn't work; switch to Bellman-Ford)
- Unreachable nodes
- Performance limits with a very large number of nodes
Round 2: Project deep dive + behavioral
A deep dive into two projects on my resume, focusing on:
- What problems I ran into
- What I did about them
- What I learned
Whenever I mentioned a specific number, the interviewer asked exactly how and where the data came from.
Trade-off questions were mixed in, testing how I balance cost against latency.
Round 3: Behavioral + sliding window
Behavioral
Outside your responsibility & Tough feedback
Coding: longest subarray with total under a threshold
Problem: given a time series of order amounts, find the longest contiguous subarray whose total doesn't exceed a threshold.
Approach: sliding window (two pointers). Expand to the right; when the total exceeds the threshold, move the left pointer in. Update the maximum valid length at each step.
def longest_within_budget(orders, threshold):
"""orders are non-negative amounts"""
left = total = best = 0
for right, x in enumerate(orders):
total += x
while total > threshold and left <= right:
total -= orders[left]
left += 1
best = max(best, right - left + 1)
return best
Discussion points:
- What if the array has negative numbers? — The window sum is no longer monotonic and the sliding window breaks; use prefix sums with a sorted structure / monotonic stack instead.
- Edge cases such as an empty array.
Round 4: Bar Raiser
Behavioral
Centered on Amazon Leadership Principles such as Ownership, Customer Obsession and Dive Deep.
Coding: top K orders
Problem: a stream of Amazon orders, each with an amount; maintain the K highest-value orders in real time.
Approach: keep a min-heap of size K and go through the orders:
- If the heap isn't full, push.
- If it's full and the new amount is larger than the top, replace the top.
- At the end the heap holds the top K orders.
import heapq
def top_k_orders(amounts, k):
heap = []
for x in amounts:
if len(heap) < k:
heapq.heappush(heap, x)
elif k > 0 and x > heap[0]:
heapq.heapreplace(heap, x)
return sorted(heap, reverse=True)
Discussion: massive data streams and limited memory.
Takeaways
The algorithms themselves weren't unusual, but there's a clear emphasis on behavioral + real-world framing + follow-ups. Round 2 and the Bar Raiser in particular keep digging into project data, trade-offs and Ownership.
Found this helpful? Let's talk.
Happy to swap interview notes, do mock interviews, or share referral info.

Scan to add me on WeChat
More Amazon notes
View all ›Amazon New Grad Four-Round VO: What Changed This Year + Three Business-Scenario Coding Questions + Bar Raiser Deep DiveAmazon · 2026-10-04›
Amazon China SDE 27NG Four-Round VO: GenAI Behavioral + Topological Sort + Minimum Size Subarray + Binary SearchAmazon · 2026-10-02›
Amazon New Grad Interview Question: TaskScheduler, Fully Analyzed (Topological Sort)Amazon · 2026-10-02›
Amazon SWE Four-Round VO (Passed): Bracket Nesting Depth + Group Anagrams + Vending Machine OODAmazon · 2026-10-02›