Design and implement a Buy Now Pay Later (BNPL) system for Flipkart.
Unlock detailed company stats for this questionUpgrade
Design and implement a BNPL system from scratch, fully in memory (no DB), with a driver/main program to demo it.
Core requirements:
- seed_inventory: load products (name, count, price) into an in-memory store.
- view_inventory: display the current inventory state.
- register_user: register a user with an initial BNPL credit limit.
- buy(user, items, payment_method, date): place an order via PREPAID or BNPL. For BNPL, reduce the credit limit and block the order if the limit is exhausted.
- clear_dues(user, orderIds, date): partial or full due clearance against specific orders.
- view_dues(user, date): show all pending dues before the given date, sorted by purchase date, with status PENDING or DELAYED (if the 30-day window is crossed).
- order_status(user): show full order history and the available BNPL credit limit.
Bonus: blacklist users who default on 3+ orders and block BNPL for them; add_inventory / remove_inventory for dynamic inventory management.
The interviewers looked for clean OOP design (interfaces, contracts, separation of concerns), extensibility, and edge case handling (credit exhaustion, 30-day window, partial payments).
Format · Technical interview.
Community answers
No answers contributed by the community yet.
Related questions
Design and implement a Buy Now, Pay Later system.Implement a Buy Now Pay Later (BNPL) system.Implement Flipkart's Buy Now Pay Later (BNPL) feature.Related courses

Course

Course
Course
