← Plaid Interview Insights

Plaid·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Plaid SWE interview with a coupon-discount coding problem that escalated pretty quickly from a single coupon to multi-coupon stacking with a bunch of edge cases to handle. Clean code, tests, and complexity discussion all expected.

Questions Asked (1)

Q1

You have a shopping cart where each item has a category and a price, plus a list of coupons. First, implement applying a single coupon (fixed discount or percentage off a category) and compute the final total. Then extend it to handle multiple coupons with stacking rules you define. Make sure to handle: discounts exceeding the item price (floor at zero), the same category targeted by multiple coupons, and percentage discounts over 100%. Write tests and discuss time complexity.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

The single-coupon phase felt manageable but I underestimated how much design thinking the multi-coupon part required.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining a clear data model for items and coupons, then implement a single-coupon application with edge cases (floor at zero, cap percentage at 100%). For multiple coupons, propose a stacking order (e.g., fixed before percentage, or best discount first) and explain trade-offs, then write tests covering edge cases and analyze time complexity.

Pro tip: Explicitly state your assumptions about coupon stacking and edge-case handling before coding—this shows you think about ambiguous requirements and can lead the discussion. Also, mention that you would confirm with stakeholders whether coupons can be combined and in what order, as this is a common real-world ambiguity.

1. Clarify requirements and define data model

Ask clarifying questions about coupon types, stacking rules, and edge cases. Define classes/structures for Item (category, price) and Coupon (type, value, category).

2. Implement single coupon application

Write a function that applies one coupon to the cart, handling fixed discounts (floor at zero) and percentage discounts (cap at 100% and floor at zero). Compute the final total.

3. Extend to multiple coupons with stacking rules

Define and justify a stacking order (e.g., apply all fixed discounts first, then percentage discounts, or sort by best discount). Implement the logic, ensuring each coupon applies to the remaining price after previous discounts.

4. Write comprehensive tests

Create unit tests covering: single coupon, multiple coupons, discounts exceeding price, same category multiple coupons, percentage >100%, and no coupons. Use edge cases to validate correctness.

5. Analyze time complexity and discuss trade-offs

Analyze the time complexity of your solution (e.g., O(n + m) for n items and m coupons). Discuss trade-offs of different stacking orders and potential optimizations.

Key Points to Mention

  • Handling edge cases: floor discounts at zero, cap percentage discounts at 100%, and ensure no negative totals.
  • Stacking rules: define a clear order (e.g., fixed before percentage, or apply best discount first) and justify why.
  • Same category targeted by multiple coupons: decide whether to apply all sequentially or only the best one, and explain the choice.
  • Time complexity: aim for O(n + m) by iterating through items and coupons once, avoiding nested loops where possible.
  • Test coverage: include unit tests for each edge case and scenario, and consider property-based testing for robustness.
  • Communication: explain assumptions and trade-offs clearly, and be open to feedback or alternative approaches.

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