Design and implement a Buy Now, Pay Later system.
Build it from scratch with working code, for Flipkart. API surface: seed_inventory (load products with name, count, price into an in-memory store), view_inventory, register_user (with an initial BNPL credit limit), buy(user, items, payment_method, date) via PREPAID or BNPL (BNPL reduces the credit limit and is blocked when the limit is exhausted), clear_dues(user, orderIds, date) (partial or full clearance against specific orders), view_dues(user, date) (pending dues before the given date, sorted by purchase date, with status PENDING or DELAYED once the 30-day window is crossed), order_status(user) (order history plus available BNPL credit limit). Bonus: blacklist users who default on 3+ orders and block BNPL for them; add_inventory / remove_inventory.
Expect follow-ups like
- Bonus: blacklist users who default on 3+ orders and block BNPL for them; support add_inventory and remove_inventory.
Format · Machine coding round; working code required.
Also asked as · Design and implement a Buy Now Pay Later (BNPL) system.
Community answers
Related questions
Design and implement a Buy Now Pay Later (BNPL) system for Flipkart.Implement a Buy Now Pay Later (BNPL) system.Design and implement a ranked cache system.Related courses



