Plaid·Software Engineer·Onsite - Coding / Algorithms
- 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. Handle edge cases: discount exceeding item price (clamp to zero), same category targeted by multiple coupons (define your rule), and percentage discounts above 100% (cap at free). Write clean code, test cases, and analyze time complexity.
“This felt manageable at first and then the edge cases kept stacking up.”