// Interview Prep/Industry Questions/E-commerce QA

🟠 E-commerce QA

7 questions · full model answers. Checkout pipelines, inventory concurrency, and promotion logic — testing where money, real-time stock, and discounts collide.

// What they weigh

What a E-commerce QA interviewer is actually probing for — beyond generic QA.

  • 01

    Checkout-pipeline integrity

    Checkout is a multi-step pipeline where cart state can diverge from checkout state. Interviewers want you to reason about price drift, session expiry, and guest-vs-authenticated divergence across the funnel.

  • 02

    Inventory concurrency

    The signature e-commerce bug is overselling the last unit to two simultaneous buyers. They listen for race-condition reasoning and exactly-once outcomes, not single-user happy paths.

  • 03

    Promotion and pricing correctness

    Coupons interact multiplicatively and prices are recalculated server-side. Strong candidates test stacking floors, server-authoritative totals, and tampering resistance.

// Junior · 2

Write the test cases for a guest checkout flow on an e-commerce site.

Junior

Walk the funnel — cart → address → shipping → payment → confirmation — and cover the guest-specific divergences: no saved data, email-only identity, and guest-to-account conversion afterwards.

// What interviewers look for

That you see checkout as a multi-step funnel with state carried between steps, and that the guest path has its own bug set distinct from the authenticated path.

Common pitfall

Testing checkout as a single screen and ignoring that guest flows lack saved addresses/payment and have to handle order lookup and later account linking by email.

Model answer

I'd map the funnel and test each transition plus the state carried forward. Cart: add, update quantity, remove, and an out-of-stock item appearing at checkout. Address: validation, required fields, an unsupported shipping region. Shipping: rate selection and the total updating correctly. Payment: a valid sandbox card, a decline, a 3DS challenge, and a gateway timeout. Confirmation: order created once, confirmation email sent, correct totals. Then the guest-specific cases: there's no saved data so I check the email-only identity, the order-lookup token can't be guessed, and if the guest later registers with the same email the past order associates to the new account. I'd also cover session expiry mid-funnel and back-button re-submission. The point is the funnel carries state between steps, so I assert it stays consistent end to end, and the guest path diverges from the logged-in path at identity and persistence.

checkoutguestfunnelsession

How would you test a coupon-code entry field at checkout?

Junior

Test that expired, already-used, invalid, and valid codes each produce a distinct, correct outcome — and that the discount recalculates the cart total server-side.

// What interviewers look for

Distinct handling of each failure class (not one generic error), and awareness that codes can stack — leading toward the below-zero question.

Common pitfall

Only testing one valid and one invalid code, and assuming a single 'invalid coupon' message covers expired, used, and malformed cases that should be distinguishable.

Model answer

I'd cover the categories separately because they behave differently: a valid unused code applies the right discount; an expired code is rejected with an expiry-specific message; a single-use code already redeemed is rejected as used; a malformed/unknown code is rejected as invalid; and a code that doesn't meet its minimum-spend or product condition is rejected with that reason. For each valid application I assert the cart total recalculates server-side, not just visually. Then the interaction cases: applying a second code (stacking), removing the discounted item after applying a code, and re-applying after removal. I'd add a rate limit / brute-force check on the validation endpoint so codes can't be enumerated. The signal is that 'invalid' is several distinct states, and the total is always the server's number.

couponspromotionsvalidationpricing

// Mid-level · 3

Two customers add the last unit of a product to their cart and check out at the same instant. How do you test this?

Mid-level

Fire two concurrent purchase requests against a 1-stock item and assert exactly one order is confirmed while the other gets a clean out-of-stock error — stock never goes negative.

// What interviewers look for

Concurrency reasoning: that inventory is shared mutable state, that the test must run requests in parallel (not sequentially), and that the correct outcome is exactly-one-succeeds.

Common pitfall

Testing the two purchases sequentially, which never reproduces the race, or accepting 'both got an error' / 'both succeeded' as anything other than a bug.

Model answer

The defect only appears under true parallelism, so I'd seed a product with stock = 1 and fire two add-to-cart-and-purchase requests simultaneously — at the API level, with controlled timing — rather than clicking through two browsers one after another. The assertion is exactly one confirmed order and one explicit out-of-stock failure, with the final stock at zero, never negative, and no orphaned order row. I'd repeat the race many times because it's probabilistic, and I'd test the variants: both add to cart but only one pays, both reach payment, and a reservation timing window where stock is held during checkout and released on abandonment. I'd automate this as a concurrency test in CI against seeded stock, never against live inventory. Underneath, I'm checking whether the write is serialised — a row lock or atomic decrement — so the answer is really about how the system protects shared mutable state.

inventoryconcurrencyrace conditionoversell

How do you test that stacking multiple valid coupons can't drop an order total below zero (or below cost)?

Mid-level

Apply combinations of valid codes to low-value carts and assert the total never goes below a defined floor, with the discount recomputed server-side and a cap on how many codes stack.

// What interviewers look for

That discounts compound multiplicatively and need a server-enforced floor, and that you'd test the combination matrix rather than single codes.

Common pitfall

Validating each coupon in isolation. The exploit is in the interaction — a percentage code plus a free-shipping code on a $5 order reaching $0.00 and being accepted with no payment.

Model answer

I'd build a small matrix of coupon combinations and run them against deliberately low-value carts where the floor is reachable: a 90%-off plus free-shipping on a $5 order, two percentage codes, a fixed-amount code larger than the subtotal. For each I assert the total stops at the defined floor (typically not below zero, often not below cost) and that the order can't complete at $0.00 without a payment step. I'd confirm the total is recomputed on the server, ignoring any client-submitted price, so request tampering can't force a lower amount. I'd test the stacking rules themselves: if only one code is allowed, a second is rejected; if N stack, the N+1th is refused. And the orphan case — apply a code, then remove the qualifying item — the discount must clear. Pairwise generation keeps the combination count manageable. The domain signal is that discounts interact, so the test target is the interaction and its floor, not the individual code.

couponsstackingpricingserver-side

An item's price changes while it's sitting in a customer's cart. What do you test?

Mid-level

Add the item at price A, change the price to B, then proceed to checkout without refreshing — and assert the customer is charged the server's current authoritative price, with the change surfaced before payment.

// What interviewers look for

Awareness that cart state and checkout state can diverge, and that the charged amount must be the server-recalculated price, not the stale cart price the client is holding.

Common pitfall

Assuming the cart price is the source of truth. The bug is the customer being silently charged a stale price — or, worse, exploiting a stale lower price the server should have corrected.

Model answer

This is a cart-vs-checkout divergence test. I'd add an item to the cart at price A, change the price to B via the admin path, then continue to checkout without refreshing so the client still holds A. The assertion is that the server recalculates at confirm time and the customer pays the authoritative current price — and critically that a price increase is shown to the customer before payment is taken, not applied silently. I'd test both directions: a drop (customer should benefit or at least see the lower price) and a rise (must not be charged more than they agreed without acknowledgement). I'd add the tampering case — submitting a forged lower price in the request — and assert the server ignores it. I'd also cover a stale cart reopened days later where the item is now out of stock or discontinued. The principle is that the client cart is a convenience, the server price is the truth, and any divergence must be reconciled visibly before charging.

pricingcartcheckoutconsistency

// Senior · 1

A payment gateway is external and asynchronous — authorisation, capture, and webhook confirmation can each fail independently. How do you test a gateway timeout without a live gateway?

Senior

Stub the gateway (WireMock) to time out or drop the webhook, and assert no confirmed order or decremented inventory is left behind — the customer sees a clear pending/retry state, not a ghost order.

// What interviewers look for

That payment is three independent async events, that the failure mode is an order/inventory state stuck between confirmed and failed, and that you test it with a controllable stub rather than a real gateway.

Common pitfall

Treating payment as one synchronous call. The real bug is a ghost order — an order row created but never confirmed because the webhook was dropped — and inventory decremented for a sale that didn't complete.

Model answer

I'd separate the three phases — authorise, capture, webhook confirmation — and inject failure into each with a gateway stub like WireMock so I control timing deterministically. The headline scenario: submit payment, let authorisation succeed, then drop or delay the confirmation webhook. The assertion is that no order is left in the confirmed state and inventory isn't permanently decremented for an unconfirmed sale — the order sits in an explicit pending state and the customer gets a clear message, not a blank page or a false success. I'd test the reconciliation path: when the webhook finally arrives late, the pending order resolves correctly and doesn't double-process. I'd also cover a network timeout on submit where the client doesn't know if it went through, and assert an idempotent retry doesn't create a second order. The distinction I'd stress versus a fintech-style question is that here the assertion target is order and inventory state, not a ledger balance.

paymentsgatewayasyncwiremockghost order

// Lead · 1

Design the pre-release test plan for a Black Friday flash sale.

Lead

Combine peak-load testing with the inventory race and coupon-matrix suites under traffic, prioritised by revenue risk: oversell, checkout availability, and promo exploits are the headline failures.

// What interviewers look for

Risk-prioritised planning that fuses correctness (inventory, coupons) with performance (peak concurrency), plus a rollback and monitoring posture for the event itself.

Common pitfall

Treating it as pure load testing and forgetting that the correctness bugs (oversell, coupon stacking) get far more likely precisely when concurrency spikes.

Model answer

Black Friday is where correctness and performance failures collide, so I'd plan for both at once. Risk order: checkout must stay available (lost checkout = lost revenue), inventory must not oversell under spike concurrency, and promotions must not be exploitable at scale. I'd run load tests that model the real shape — a thundering-herd at sale open, hot products, and concurrent coupon redemption — and within that load assert the inventory race holds (the last-unit test under real parallelism) and the coupon-floor matrix holds. I'd test graceful degradation: queueing, rate limits, and a clear pending state on gateway slowness rather than 500s. Operationally I'd have the rollback plan agreed with infra and payments, real-time dashboards on oversell/error-rate/checkout-conversion, and a kill switch for individual promos. Pre-event I'd freeze risky changes and run the full isolation/checkout/refund regression. The plan is explicitly ranked by revenue impact, because under flash-sale load the rare race becomes common.

strategyload testingflash salerisk-based

// Go deeper

These questions pair with the in-depth E-commerce QA QA guide — the risk areas, signature bugs, and test strategies the questions are drawn from.