Skip to main content
All Questions

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:

  1. seed_inventory: load products (name, count, price) into an in-memory store.
  2. view_inventory: display the current inventory state.
  3. register_user: register a user with an initial BNPL credit limit.
  4. 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.
  5. clear_dues(user, orderIds, date): partial or full due clearance against specific orders.
  6. 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).
  7. 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 courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.