LIMITED TIME 🎁: Register now to get 60 minutes of AI Mock Interviewing for FREE!

Join
    AWS Interview Insights
    AWS logo
    AWS·Software Engineer·Onsite - Multi Round·Intermediate
    IntermediateRejected
    Jul 2026
    5

    Summary

    Went through the full AWS SDE II loop, two days of back-to-back interviews covering system design, two DSA rounds, and a bar raiser behavioral plus low-level design session. The OA was interesting because one part involved debugging an unfamiliar codebase with AI assistance rather than writing from scratch. Got rejected in the end, mainly for not communicating my thinking clearly enough.

    Questions Asked(5)

    System DesignTechnical Trade-offs
    A
    Author's notesFirst line only

    This was the one I bombed.

    Suggested Approach

    Start by clarifying requirements and defining the core entities (customers, sellers, books, listings), then design the data flow from purchase request submission through price matching to order fulfillment. Emphasize scalability, consistency trade-offs, and how AWS-native services can be leveraged to handle high throughput and fault tolerance.

    Pro tip: Proactively discuss the CAP theorem trade-off in the context of inventory and pricing — specifically whether you prioritize consistency (avoiding overselling) or availability (always accepting requests), as this decision cascades into your entire architecture and signals senior-level thinking.
    1

    Clarify Requirements & Scale

    Ask about expected read/write ratios, number of sellers, catalog size, and SLA expectations (e.g., latency for price matching). Confirm whether 'best deal' means lowest price, fastest delivery, or a combination of factors.

    2

    Define Core Entities & Data Model

    Identify key entities: Book (ISBN, metadata), Seller, Listing (seller + book + price + inventory), and PurchaseRequest (customer, book, max_price). Design the schema to efficiently support price-range queries and inventory lookups.

    3

    Design the Price Matching Engine

    Describe how incoming purchase requests are matched against available listings — for example, using a sorted index or priority queue on price per book ISBN filtered by max_price. Address how to handle concurrent requests to prevent race conditions and overselling using optimistic locking or atomic inventory decrements.

    4

    Define the System Architecture & Components

    Outline the major services: an API Gateway for ingestion, a matching service (stateless, horizontally scalable), a listings/inventory store (e.g., DynamoDB with conditional writes), an order service, and an async notification layer (e.g., SQS/SNS for seller and customer updates). Mention caching (ElastiCache) for hot book listings.

    5

    Address Scalability, Reliability & Trade-offs

    Discuss how the system handles traffic spikes (auto-scaling, queue-based buffering), failure scenarios (idempotent order creation, dead-letter queues), and monitoring (CloudWatch metrics on match rate, latency, failed transactions). Explicitly call out trade-offs made, such as eventual consistency in inventory counts vs. strong consistency.

    Key Points to Mention

    Optimistic locking or conditional writes (e.g., DynamoDB ConditionExpression) to prevent overselling when multiple customers compete for the same listing
    Indexing strategy for efficient price-range queries — e.g., a Global Secondary Index on (ISBN, price) in DynamoDB or a sorted set in Redis
    Asynchronous processing via SQS to decouple request ingestion from matching and order fulfillment, improving resilience under load
    Idempotency keys on order creation to safely handle retries without duplicate purchases
    Eventual vs. strong consistency trade-off: accepting slight inventory inaccuracies for higher availability vs. strict locking for correctness
    Seller onboarding and listing management as a separate write path, with cache invalidation or TTL strategies to keep the matching engine's view fresh
    Algorithms & Data Structures
    A
    Author's notesFirst line only

    Knew this one.

    Suggested Approach

    Use two heaps — a max-heap for the lower half and a min-heap for the upper half of the data stream — to maintain a balanced partition where the median can be retrieved in O(1) time. Explain the invariant that the two heaps differ in size by at most one, and that every element in the max-heap is less than or equal to every element in the min-heap. Walk through the addNum and findMedian operations clearly, covering both even and odd total element counts.

    Pro tip: Mention the trade-offs and potential follow-up constraints AWS interviewers love — such as handling very large streams with memory limits, or if the data has a known bounded range (where a bucket/counting sort approach could outperform heaps). This signals systems-level thinking beyond the textbook solution.
    1

    Clarify the Problem

    Confirm that numbers arrive one at a time in a stream and the median must be retrievable at any point. Ask if there are constraints on memory, data range, or whether duplicates are allowed.

    2

    Explain the Two-Heap Design

    Describe using a max-heap (lo) to store the smaller half and a min-heap (hi) to store the larger half, maintaining the invariant that |lo.size - hi.size| <= 1 and lo.top() <= hi.top().

    3

    Walk Through addNum Logic

    Show the insertion logic: push to lo, then rebalance by moving lo's max to hi if needed, and if hi becomes larger than lo, move hi's min back to lo to maintain the size invariant.

    4

    Walk Through findMedian Logic

    Explain that if both heaps are equal in size, the median is the average of both tops; if lo has one extra element, the median is lo's top — achieving O(1) retrieval.

    5

    Analyze Complexity and Trade-offs

    State that addNum is O(log n) due to heap operations and findMedian is O(1), then briefly mention alternatives like order-statistics trees or sliding-window variants for follow-up scenarios.

    Key Points to Mention

    Max-heap for lower half, min-heap for upper half — and why this partition enables O(1) median access
    The balancing invariant: heaps differ in size by at most one, and lo.top() <= hi.top() at all times
    Step-by-step addNum rebalancing logic to maintain the invariant after each insertion
    O(log n) time for insertion and O(1) time for median retrieval
    Edge cases: single element in the stream, even vs. odd total counts, and duplicate values
    Follow-up optimizations: bounded data range using bucket counting, or handling memory constraints in a distributed stream (relevant to AWS scale)
    Algorithms & Data Structures
    A
    Author's notesFirst line only

    Two-pointer problem, medium difficulty.

    Suggested Approach

    Start by identifying the boundaries of the unsorted subarray by finding where elements deviate from sorted order from both ends. Then expand those boundaries outward to ensure all elements in the subarray are within the correct global min/max range, guaranteeing the full array becomes sorted after sorting just that subarray. Aim for an O(n) time and O(1) space solution to demonstrate optimal thinking.

    Pro tip: Mention edge cases upfront — such as an already-sorted array (answer is 0) or a fully reversed array — to show defensive coding instincts that AWS values in production-grade systems. Also briefly acknowledge the naive O(n log n) approach before presenting the optimal O(n) solution to demonstrate your ability to iterate toward efficiency.
    1

    Clarify & State Examples

    Confirm input constraints (e.g., duplicates allowed, negative numbers) and walk through a concrete example like [2, 6, 4, 8, 10, 9, 15] to ground your explanation. Identify the expected output (length 5, subarray [6,4,8,10,9]) before diving into the algorithm.

    2

    Find Initial Boundary Candidates

    Scan left-to-right to find the last index where arr[i] > arr[i+1] (right boundary candidate), and right-to-left to find the last index where arr[i] < arr[i-1] (left boundary candidate). This gives a rough window of disorder.

    3

    Determine Min and Max of the Window

    Find the minimum and maximum values within the candidate subarray window identified in step 2. These values are critical for correctly expanding the window boundaries.

    4

    Expand Boundaries to Correct Positions

    Extend the left boundary leftward to include any elements greater than the window's minimum, and extend the right boundary rightward to include any elements smaller than the window's maximum. This ensures sorting the subarray will produce a globally sorted array.

    5

    Return Result & Discuss Complexity

    Return right - left + 1 as the answer (or 0 if the array is already sorted). Explicitly state O(n) time complexity and O(1) space complexity, and mention how this compares to the O(n log n) sort-and-compare naive approach.

    Key Points to Mention

    Naive O(n log n) approach: compare original array with its sorted version to find differing indices, then compute the length between first and last mismatch.
    Optimal O(n) approach: single-pass boundary detection using left-to-right and right-to-left scans without sorting.
    Importance of expanding boundaries based on the subarray's min and max to handle cases where out-of-place elements exist outside the initial disorder window.
    Edge case handling: already-sorted array returns 0, single-element array returns 0, fully reversed array returns n.
    Space complexity trade-off: the O(n) approach achieves O(1) auxiliary space, which is important for large-scale data processing at AWS.
    Duplicate elements: clarify that duplicates are handled correctly since boundary expansion uses strict comparisons against the subarray's min/max.
    System DesignAPI & IntegrationsTechnical Trade-offs
    A
    Author's notesFirst line only

    This was the bar raiser round and the LLD portion caught me a bit off guard in terms of scope.

    Suggested Approach

    Frame your answer around a layered validation architecture that separates syntactic validation (schema/type checks) from semantic validation (business rules), and explain how each layer catches different classes of errors before the order reaches downstream services. Emphasize designing for extensibility and clear error contracts so that clients receive actionable, aggregated feedback rather than fail-fast single errors. Ground your design in real trade-offs like synchronous vs. asynchronous validation and centralized vs. distributed ownership.

    Pro tip: At AWS scale, mention that validation logic should be treated as a first-class service boundary — consider exposing a dedicated Validation Service or using a pipeline/chain-of-responsibility pattern so individual validators can be independently deployed, tested, and toggled via feature flags without touching the core order workflow.
    1

    Define Validation Domains & Ownership

    Break the order into distinct validation domains — payment methods, delivery details, and order info — and assign clear ownership (e.g., Payment Service validates card/wallet rules, Inventory Service validates item availability). This prevents tight coupling and lets each domain evolve its rules independently.

    2

    Layer Syntactic Then Semantic Validation

    Apply syntactic validation first (required fields, data types, format constraints like postal codes or card numbers) using a schema validator (e.g., JSON Schema, Protobuf) at the API gateway or ingestion layer. Follow with semantic validation (sufficient funds, address deliverability, stock availability, promo code validity) which may require external service calls or DB lookups.

    3

    Design an Aggregated Error Response Contract

    Rather than failing on the first error, collect all validation violations across domains and return a structured error payload with field-level error codes, human-readable messages, and severity levels (blocking vs. warning). Define a stable error schema (e.g., RFC 7807 Problem Details) so clients can programmatically handle and display errors.

    4

    Implement a Validation Pipeline with Circuit Breakers

    Orchestrate validators in a chain-of-responsibility or pipeline pattern, running independent validators in parallel where possible (e.g., payment and address checks concurrently) to minimize latency. Add circuit breakers and fallback strategies for external validators (e.g., address verification APIs) so a third-party outage doesn't block all orders.

    5

    Gate Downstream Handoff & Observability

    Only pass a fully validated, canonicalized order object to downstream services (fulfillment, inventory reservation) once all blocking validations pass, using an immutable order DTO or event. Instrument each validation step with metrics (error rates by type, latency) and structured logs to enable rapid debugging and SLA monitoring.

    Key Points to Mention

    Separation of syntactic vs. semantic validation layers and where each lives in the architecture (API gateway vs. service layer)
    Aggregated vs. fail-fast error collection and designing a stable, structured error response contract (e.g., RFC 7807) with field-level detail
    Parallel execution of independent validators to reduce end-to-end validation latency, with a defined timeout and fallback strategy
    Idempotency and re-validation considerations — e.g., whether to re-validate on retry or cache validation results with a short TTL
    Feature flags or rule engines (e.g., AWS AppConfig) to toggle validation rules without redeployment, supporting A/B testing of new business rules
    Observability: emitting structured metrics and traces per validation domain to detect regressions, abuse patterns, or third-party degradation
    Root Cause AnalysisAlgorithms & Data Structures
    A
    Author's notesFirst line only

    Genuinely interesting format.

    Suggested Approach

    Start by systematically reading the failing test cases to understand the expected behavior, then use AI assistance to trace the execution path and pinpoint discrepancies between expected and actual outputs. Once the root cause is identified, implement a minimal, targeted fix that resolves the failure without introducing regressions in passing tests.

    Pro tip: At AWS, demonstrating operational excellence means not just fixing the bug but also explaining *why* it existed — mention edge cases, off-by-one errors, or incorrect assumptions in the original logic to show deep understanding rather than a surface-level patch.
    1

    Read and Understand the Failing Tests

    Carefully examine each failing test case to extract the expected inputs, outputs, and invariants. This defines the contract the production code must satisfy and anchors your debugging effort.

    2

    Trace the Execution Path

    Use AI assistance to walk through the relevant code paths triggered by the failing tests, identifying where actual behavior diverges from expected behavior. Look for incorrect logic, wrong data structure usage, or missed edge cases.

    3

    Identify the Root Cause

    Pinpoint the exact line(s) or logic block responsible for the failure, distinguishing between symptoms and the underlying cause. Common culprits include off-by-one errors, incorrect base cases, wrong comparators, or mutated state.

    4

    Implement and Validate the Fix

    Apply a minimal, targeted fix that directly addresses the root cause, then re-run all tests — both previously failing and passing — to confirm no regressions were introduced. Explain your reasoning for the chosen fix approach.

    5

    Communicate Findings Clearly

    Summarize what the bug was, why it occurred, and how your fix resolves it, as if writing a code review comment or incident summary. This demonstrates engineering maturity and aligns with AWS's culture of written clarity.

    Key Points to Mention

    Reading test assertions first to define expected behavior before touching production code
    Using AI tools to accelerate root cause analysis while maintaining critical human judgment over the suggested fix
    Checking for common algorithmic pitfalls such as off-by-one errors, incorrect boundary conditions, or improper handling of empty/null inputs
    Ensuring the fix is minimal and surgical to avoid unintended side effects on passing tests
    Verifying time and space complexity of the corrected algorithm to confirm it meets performance requirements
    Articulating the root cause clearly, distinguishing between the symptom (test failure) and the underlying logic error

    Discussion(5)

    Sign in to join the discussion.

    M
    MisterReview· 18d ago
    Q5OA: Given an existing codebase with failing unit tests, use AI assistance to identify why the tests are failing, locate the problematic code, and implement the fix.

    This format is genuinely underrated and I think more companies should use it. Reading a failing test, forming a hypothesis about what the code is supposed to do, using AI to navigate to the relevant section faster, then actually fixing the logic rather than just patching the test, that's closer to a real debugging session than anything a blank-slate LeetCode problem tests. The fact that you passed all cases and found it more realistic than traditional OAs is a good sign about how you'd actually perform on the job, even if the loop outcome didn't reflect that.

    A
    ArrayOfHope· 18d ago
    Q4Design the validation layer for an e-commerce order workflow, covering payment methods, delivery details, order info, and how to surface validation errors before passing the order downstream.

    The steering you described, where they kept pulling you back to just the validation layer, is a really common bar raiser move. They're checking whether you can stay focused on a scoped problem or whether you'll architect the entire universe when asked to design a door.

    For the validation layer specifically, the design that tends to land well is a chain-of-responsibility or pipeline pattern where each validator (payment, delivery, order info) is a discrete unit that returns a structured result rather than throwing an exception or returning a boolean. The key insight is that you want to collect ALL validation errors in one pass rather than failing fast on the first one, because showing a user five errors at once is a much better experience than making them fix and resubmit five times.

    So each validator returns something like a list of ValidationError objects with a field reference, an error code, and a human-readable message. The pipeline aggregates these and only passes the order downstream if the combined error list is empty. That's the error communication piece you mentioned not spending enough time on, and it's genuinely the most interesting part of this problem from a product correctness standpoint.

    On the payment abstraction, over-engineering it is easy to do because payments feel important. But for an LLD round, a PaymentMethod interface with a validate() method on each concrete type (CreditCard, PayPal, GiftCard) is probably sufficient. The interviewer likely didn't need you to model the entire payment processor integration.

    JV
    Julianna Vance· 18d ago
    Q3Given an array, find the length of the shortest subarray that, if sorted, would make the whole array sorted.

    The approach that works here is finding the boundaries of the disorder rather than trying to sort and compare. Scan left to right tracking the running max; the last index where the current element is less than that running max is your right boundary. Scan right to left tracking the running min; the last index where the current element is greater than that running min is your left boundary. The length is right minus left plus one.

    The part people sometimes fumble is the edge case where the array is already sorted, which gives you boundaries that don't form a valid range, so you return zero. Worth stating that explicitly before you code it. O(n) time, O(1) space, and the interviewer usually appreciates that you didn't reach for a sort-and-diff approach first.

    DJ
    David J. Aris· 18d ago
    Q2Find the median from a data stream (using heaps).

    Yeah this one is pretty satisfying once it clicks. Two heaps, max-heap for the lower half and min-heap for the upper half, keep them balanced within one element of each other. Median is either the top of the larger heap or the average of both tops. The only thing I'd add is that some interviewers will push on the rebalancing logic specifically, so make sure you can walk through an insertion that triggers a rebalance without hesitating.

    DJ
    David J. Aris· 18d ago
    Q1Design a book marketplace that connects customers with multiple sellers, where a customer submits a purchase request with a maximum price and the system finds the best available deal.

    The data flow anchor you mentioned is exactly right, and I learned this the hard way in a similar design round. When I tried to jump straight into components, I ended up describing a bunch of services that didn't obviously connect to each other, and the interviewer had to keep asking 'but how does the data get there?' which killed my momentum.

    For this specific problem, the core flow is: customer submits a request with a max price, the system needs to query across sellers to find who has the book at or below that price, rank the results, and return the best match. Once you have that written out as a sentence, the components almost name themselves. You need some kind of request intake (API layer), a catalog or inventory store partitioned by seller, a matching or search service that filters by price threshold and availability, and a way to rank results (cheapest first, or some weighted score if you want to get into seller ratings).

    The interesting design tension is whether you fan out to sellers in real time or maintain a pre-indexed view. Real-time fan-out is simpler to reason about but doesn't scale if you have thousands of sellers. An inverted index keyed on book ISBN with price-sorted entries per seller is more practical and lets you do a simple range query. For AWS context, that index lives somewhere like DynamoDB with a GSI on price, or even OpenSearch if you want richer filtering.

    The seller querying logic you blanked on is probably just: query the index for all entries matching the ISBN where price is less than or equal to max_price, sort ascending by price, return the top result. The edge cases worth mentioning are inventory going stale between index write and purchase commit, which you handle with a reservation or optimistic lock step before finalizing.

    Interview Details

    CompanyAWS
    RoleSoftware Engineer
    RoundOnsite - Multi Round
    LevelIntermediate
    OutcomeRejected
    DateJul 2026

    Questions in this post

    Share your own experience

    Help the community by sharing what you went through.