/css

css

Primary LanguageTypeScript

requirement

  • 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)

prerequisites

Before starting this application, you must install:

  • node.js : v16.14.0
  • npm : v8.3.1
  • yarn : v1.22.10

install & run

$ yarn
$ yarn start

unit test

$ yarn test