Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.31 KB

README.md

File metadata and controls

57 lines (43 loc) · 1.31 KB

Real-time Inventory Management Challenge

Time Limit: 30 minutes

Problem Statement

Implement a real-time inventory management system that handles multiple types of transactions while maintaining inventory consistency across multiple warehouse locations.

Setup

  1. Clone this repository
  2. Run npm install
  3. Implement the required functionality in src/inventoryManager.js
  4. Run tests with npm test

Transaction Types

  • ADD: Add inventory to a location
  • REMOVE: Remove inventory from a location
  • TRANSFER: Move inventory between locations
  • RESERVE: Temporarily hold inventory (15-minute expiration)
  • COMMIT: Convert a reservation to a removal
  • CANCEL: Cancel a reservation

Requirements

  1. Process transactions in FIFO order
  2. Maintain inventory consistency
  3. Handle reservation expiration
  4. Support multiple warehouses
  5. Prevent negative inventory
  6. Track transaction history

Input Format

{
    transactionId: string,
    type: "ADD" | "REMOVE" | "TRANSFER" | "RESERVE" | "COMMIT" | "CANCEL",
    productId: string,
    quantity: number,
    locationId: string,
    targetLocationId?: string,
    reservationId?: string
}

Evaluation Criteria

  • Correctness of implementation
  • Transaction consistency
  • Error handling
  • Edge case management
  • Code organization

Good luck!