← DoorDash Interview Insights

DoorDash·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
Apr 2026Remote

Summary

DoorDash coding interview focused entirely on a shopping cart discount system, broken into progressively harder parts. The OOD angle was the real challenge, not just the logic itself.

Questions Asked (2)

Q1

Design a shopping cart system with a promotion engine that selects the single best discount from a list of promotions. Promotions can be percentage-based (applied to item subtotal only) or fixed-amount (applied to the total including shipping). Return the final amount the customer pays after the optimal promotion is applied.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

The first part seemed manageable until I realized percentage discounts skip shipping and fixed-amount ones don't.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the data model for cart items, shipping, and promotions. Then outline a modular design with a promotion engine that evaluates each promotion independently and selects the one yielding the lowest final price. Discuss trade-offs between extensibility, performance, and correctness, and consider edge cases like empty carts or invalid promotions.

Pro tip: Emphasize that the promotion engine should be easily extensible to support new promotion types without modifying existing code, and discuss how to handle floating-point precision for monetary calculations.

1. Clarify Requirements and Assumptions

Ask questions to understand constraints: Are promotions stackable? Can they be combined? What about item-level vs. cart-level? Confirm that only one promotion is applied and that it's the best for the customer.

2. Define Data Model and Interfaces

Design classes for Cart, CartItem, Shipping, Promotion (abstract), PercentagePromotion, FixedAmountPromotion, and PromotionEngine. Specify how promotions calculate discounts based on subtotal or total including shipping.

3. Design Promotion Engine Logic

The engine iterates through all applicable promotions, computes the final price for each, and selects the minimum. Ensure promotions are applied correctly: percentage on item subtotal only, fixed amount on total including shipping.

4. Handle Edge Cases and Validation

Consider empty cart, no promotions, invalid promotions (e.g., negative discount), and rounding. Ensure the final amount is never negative and that monetary values use appropriate precision.

5. Discuss Trade-offs and Extensibility

Talk about performance (O(n) promotions), extensibility (adding new promotion types via polymorphism), and potential optimizations (caching, early termination). Mention how to test the engine.

Key Points to Mention

  • Separation of concerns: promotion engine should be independent of cart and shipping logic.
  • Use of strategy pattern or polymorphism to support different promotion types.
  • Correct application of discounts: percentage on item subtotal only, fixed amount on total including shipping.
  • Selection of the single best promotion by comparing final prices.
  • Handling monetary values with BigDecimal or integer cents to avoid floating-point errors.
  • Extensibility: adding new promotion types without modifying existing code.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Extend the promotion system to handle edge cases: minimum spend thresholds before a promotion activates, promotions that apply only to specific items rather than the whole cart, and rules preventing promotions from stacking.

System DesignTechnical Trade-offsData Modeling
Author's notes

This is where things got rough.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints of the promotion system, then propose a flexible data model that supports conditions like minimum spend, item-specific applicability, and stacking rules. Discuss how to evaluate promotions efficiently at checkout, considering trade-offs between simplicity and extensibility.

Pro tip: Emphasize idempotency and consistency in promotion application, especially in a distributed system like DoorDash, to avoid double-discounting or race conditions.

1. Clarify Requirements and Edge Cases

Ask questions to understand the scope: What types of promotions exist? How are they configured? What are the performance and consistency requirements? Identify edge cases like multiple promotions, partial cart eligibility, and threshold interactions.

2. Design a Flexible Data Model

Propose a schema that represents promotions with conditions (e.g., min spend, item scope) and actions (e.g., discount). Use a rule engine or condition tree to allow complex logic without code changes.

3. Define Evaluation and Application Logic

Outline an algorithm to evaluate promotions against a cart: filter by eligibility, sort by priority or best discount, and apply non-stacking rules. Consider pre-computation or caching for performance.

4. Address Consistency and Concurrency

Discuss how to handle concurrent cart updates and promotion application, ensuring idempotency and preventing race conditions. Mention transaction boundaries or locking strategies.

5. Discuss Trade-offs and Extensibility

Compare approaches: rule engine vs. hardcoded logic, real-time vs. batch evaluation. Highlight how the design can evolve with new promotion types and scale with DoorDash's volume.

Key Points to Mention

  • Condition evaluation: minimum spend thresholds, item-specific applicability (e.g., category, SKU), and stacking rules (exclusive vs. combinable).
  • Data modeling: promotion entity with conditions and actions, possibly using a domain-specific language (DSL) or JSON schema for flexibility.
  • Evaluation order: how to prioritize promotions (e.g., highest discount first) and handle conflicts when multiple promotions apply.
  • Performance considerations: indexing, caching, and pre-filtering to avoid evaluating all promotions for every cart.
  • Consistency: idempotent application, transactional guarantees, and handling of concurrent modifications.
  • Extensibility: designing for new promotion types without major refactoring, possibly using a plugin architecture.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.