Design and implement a coupon management system.
Design and implement a Coupon Management System for Meesho's 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, not already used by the user. The system computes the final payment amount, supports placing the order, viewing order history with applied coupons, removing cart items, and maintains coupon usage history across all users. The design should be extensible, scalable and thread safe for concurrent access.
Below the line (clarified with the interviewer): 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).
Extensions discussed after the design: capping a coupon code for certain users only (for example DIWALI10 for the first 1000 users) and handling contention when only 1000 coupons exist across concurrent users; applying multiple coupons in the same order.
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.
Community answers
Related questions
Design a gym management system.Design a voter management system.Design and implement a ranked cache system.Related courses


