Amazon
Top Amazon Software Engineer Interview Questions 2026
Prep tips for Amazon SDE
- Every round maps to Leadership Principles — prepare STAR stories tied to each
- "Dive Deep" and "Ownership" are tested most frequently across roles
- A Bar Raiser is present in every loop — they vote independently of the hiring team
- System design should cover failure modes and idempotency, not just the happy path
- Since the array is sorted, use the two-pointer technique. Left at 0, right at n-1. If sum < target, move left up; if sum > target, move right down; if equal, return. O(n) time, O(1) space — better than the hash-map approach when sorted-ness is given.
- Order service accepts request → inventory check (with reservation) → payment authorization → warehouse selection (closest with stock) → shipping label generation → carrier handoff. Use idempotency keys for payment retries. Eventual consistency for inventory across regions. Saga pattern with compensating transactions for rollback. Event-driven (SNS/SQS) for cross-service communication.
- Maps to the Ownership LP. STAR: surface a problem that wasn't formally your responsibility (e.g., a broken on-call alert, a recurring customer complaint). Action: drove to resolution end-to-end without being asked — coordinated stakeholders, documented the fix, prevented recurrence. Result: measurable improvement (incidents reduced, SLA recovered).
- BFS with a hashmap from original node → cloned node. Phase 1: create clone nodes for every reachable original. Phase 2: iterate originals and wire each clone's neighbors using the map. Handles cycles naturally because the map prevents re-creating. DFS recursive version is also clean. O(V+E) time.
- Hybrid: collaborative filtering (users who bought X also bought Y) plus content-based (item features). Offline batch with Spark for matrix factorization. Feature store (e.g., DynamoDB/Redis) for low-latency serving. Online layer for context (current session, cart) and re-ranking. A/B test recommendation strategies. Cover cold-start: popularity fallback for new users, content-based for new items.
- Maps to Earn Trust LP. Choose a real failure with real consequence — not a fake humble-brag. Own it directly. Walk through the root-cause analysis (data, not blame). Articulate the concrete learning and the behavior change after — what would they see different on your next project? Numbers strengthen the answer.
- Best: bucket sort. Build frequency map, then put numbers into buckets indexed by frequency. Iterate from the highest bucket down, collecting until you have K. O(n) time, beats the O(n log k) heap approach. Mention the heap solution as well for comparison.
- Consistent hashing to distribute keys across nodes; virtual nodes for even load. Eviction policies — LRU, LFU, TTL. Replication for HA (primary + replica). Invalidation strategies: write-through, write-back, write-around. Failure handling: replica promotion, gossip for membership. Cache-aside vs read-through tradeoffs. Mention hot-key mitigation (request coalescing, local cache layer).
- Maps to Bias for Action LP. Show decisive action without paralysis. STAR: a decision needed (often a deadline). Action: enumerate assumptions explicitly, picked the reversible-decision path, built in checkpoints to validate. Result: shipped on time, validated assumptions iteratively, corrected course when needed. Amazon prizes "most decisions are two-way doors."
- DFS with three states per node: unvisited, in-progress, done. If during DFS you hit an in-progress node, that's a back edge → cycle exists. Alternative: Kahn's topological sort with in-degree — if processed count < n, there's a cycle. O(V+E) both ways.
- Key-value model: bucket + key → object bytes + metadata. Consistent hashing for placement; 3-way replication across AZs for durability. Metadata service separate from data plane. Multipart upload for large objects. Versioning with delete markers. Pre-signed URLs for delegated access. Strong consistency for new objects (post-2020). Cover background tasks: garbage collection, integrity checks, lifecycle policies.
- Maps to Have Backbone; Disagree and Commit LP. Frame as respectful disagreement backed by data — you brought a benchmark, customer signal, or risk analysis. Show you escalated appropriately, then committed fully once a decision was made (no passive resistance). End with the outcome and a strengthened working relationship.
- 2D DP. dp[i][j] = LCS length of s1[0..i] and s2[0..j]. If s1[i-1] == s2[j-1]: dp[i][j] = dp[i-1][j-1] + 1, else max(dp[i-1][j], dp[i][j-1]). O(m·n) time and space. Space can be reduced to O(min(m,n)) with rolling rows.
- Token bucket or sliding window log. Distributed state in Redis with atomic INCR + EXPIRE. Per-user, per-API, and global limits. Return 429 with Retry-After header. Burst allowance via leaky bucket. Failure mode: fail open or fail closed depending on tier. Tier-based limits (free, standard, premium) with separate buckets. Synchronize state across regions with eventual consistency for global throttles.
- Maps to Deliver Results LP. STAR with explicit scope tradeoffs — what you cut, what you preserved. Show prioritization framework, daily standups, risk surfacing. Numbers: original timeline vs delivered timeline, what shipped vs deferred. End with downstream impact (revenue, customer milestone) — not just "we hit the date."
- Sort meetings by start time. Min-heap of end times. For each meeting: if the earliest end time ≤ current start, reuse that room (pop). Push current end. Final heap size = rooms needed. O(n log n) time. Alternative: chronological sort of start and end events.
- Inverted index for retrieval. First-pass scoring with BM25 over title/description. ML reranking with features: purchase probability, click-through rate, personalization (browsing history), price, reviews, availability. Real-time pipeline for fresh products; offline pipeline for model training. Pinning for sponsored items. Cover negative feedback loop (low CTR demotes).
- Maps to Customer Obsession LP. Choose an example with measurable customer outcome. Show empathy (you understood the customer's actual pain, not just the surface request) and proactive action (you fixed something they didn't know to ask for). Quantify: customer retained, NPS up, time saved.
- Build a Trie of all target words. DFS from each cell on the board, traversing the Trie in parallel. Prune Trie branches when a word is found or no continuation exists. Mark visited cells temporarily during DFS. Much faster than running a single-word search for each input word. Time: O(M·N·4^L) worst case, much less with Trie pruning.
- Maps to Invent and Simplify LP. Choose a problem where the conventional solution was wrong or absent, and your approach materially simplified the system. Frame the existing complexity, your insight, the simpler design, and the operational savings (lines of code reduced, fewer services, fewer alerts). Amazon values simplification over invention for its own sake.
Practice these questions with Cogniv
Get real-time AI answers during live mock interviews. Free to start.
Start practicing →