- The system should receive 2 delivery orders per second
- Each order takes some time (defined as
prepTime
in order JSON) to be prepared - Upon receiving an order, the system should immediately dispatch a courier
- Couriers arrive randomly following a uniform distribution, 3-15 seconds after they’ve been dispatched
- Matched: a courier is dispatched for a specific order and may only pick up that order
- First-in-first-out
- Average food wait time (milliseconds) between order ready and pickup
- unit testing
- Average courier wait time (milliseconds) between arrival and order pickup
- unit testing
- console output (order received, order prepared, courier dispatched, courier arrived, order picked up)
Before starting this application, you must install:
- node.js : v16.14.0
- npm : v8.3.1
- yarn : v1.22.10
$ yarn
$ yarn start
$ yarn test