Skip to main content
All Questions

Design and implement a Buy Now, Pay Later system.

Unlock detailed company stats for this questionUpgrade

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

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.