Skip to content

rizalrinoldi/inventory-manager-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published