Design and implement a coupon management system.
Unlock detailed company stats for this questionUpgrade
Design and implement a coupon management system for an e-commerce platform. Users can browse a product catalog, add multiple items to a cart (no limits), view available coupons and apply one.
Coupons are flat or percentage-based (percentage coupons have an upper limit) and must be validated: not expired, applicable to the current purchase amount, and not already used by the user.
The system should:
- compute the final payment amount
- support placing the order
- show order history with applied coupons
- allow removing cart items
- maintain coupon usage history across all users
The design should be extensible, scalable and thread safe for concurrent access. Out of scope: scheduled removal of expired coupons, searching products by name or id, and user- or product-specific coupons (assume any coupon works for any user on any product).
Expect follow-ups like
- Scheduled removal of expired coupons; searching products by name/id; user- or product-specific coupons were clarified with the interviewer as below-the-line requirements.
- Cap a coupon code for certain users only, for example DIWALI10 for the first 1000 users, and handle contention when only 1000 coupons exist across concurrent users.
- How would you support applying multiple coupons in the same order?
Community answers
No answers contributed by the community yet.
Related questions
Design a gym management system.Design a voter management system.Design and implement a ranked cache system.Related courses

Course

Course
Course
