Retail POS System

Difficulty: MEDIUMCategory: LLDFrequency: 1Asked On 2021-06-13

Problem Statement

Design and implement a Retail Point of Sale (POS) system that handles in-store transactions for a retail outlet. The system should support product management, billing, payments, and inventory tracking while ensuring smooth checkout for customers.


🔶 Functional Requirements


1.Product & Inventory Management
•Add, update, and delete products (ID, name, category, price, discount, barcode).
•Maintain stock quantity for each product.
•Track low-stock alerts.
2.Billing & Checkout
•Scan products via barcode or manual entry.
•Apply discounts, offers, and taxes.
•Generate invoices/receipts for customers.
•Support cart operations (add/remove/update items).
3.Payment Processing
•Support multiple payment modes: Cash, Card, Wallet, UPI.
•Split payments (e.g., half cash, half card).
•Handle failed transactions gracefully.
4.User & Role Management
•Cashier login to process sales.
•Admin role for product and price management.
5.Reports & Audit
•Daily sales report.
•Inventory usage and restocking needs.
•Transaction history per cashier.


🔶 Non-Functional Requirements


•Performance: Must handle checkout quickly (<2s per transaction).
•Concurrency: Multiple POS terminals accessing inventory simultaneously.
•Consistency: Ensure stock updates are atomic and correct.
•Scalability: Support thousands of products in the catalog.
•Extensibility: Future support for loyalty programs, coupons, or integration with e-commerce.


🔶 Constraints


•Each transaction must have at least one payment method.
•Tax and discounts should be configurable per product or bill-level.
•A product cannot be sold if stock is 0.


🔶 Example Use Case


1.A cashier logs in to the POS terminal.
2.Customer purchases:
•2x Milk (₹40 each),
•1x Bread (₹30),
•Discount coupon of 10%.
3.POS calculates total = ₹110 → 10% discount → ₹99.
4.Customer pays ₹50 cash + ₹49 card.
5.Invoice is generated and inventory is updated.
6.End of day, the admin generates sales & inventory report.


👉 In short:

Design and implement a Retail POS System that supports product management, checkout, billing, multi-mode payments, inventory tracking, and reporting, while ensuring concurrency, accuracy, and fast processing.

Solution

Comments