Direkt zum Inhalt der SeiteDirekt zur Hauptnavigation
Your task is to create a service that is able to fulfill orders in some commerce site.
As the input you have a list of available products and locations in the following form:

LOCATION SKU AMOUNT
Gliwice prod-1 10
Gliwice prod-2 12
Gliwice prod-3 5
Munich prod-1 4
Munich prod-2 4
Munich prod-3 4
Montreal prod-1 4
Montreal prod-4 5

As second input you have a list of submitted orders in the following format:

DESTINATION SKU AMOUNT
Sydney prod-1 14
Sydney prod-2 10
Sydney prod-3 3
Tokyo prod-2 6
Sydney prod-3 1
Tokyo prod-4 5

where:

  • LOCATION is the string that identifies the store in which product is available
  • DESTINATION is the string that identifies the delivery address for the order
  • SKU (stock-keeping unit) is the string identifies the product
  • AMOUNT is the number of products available in given location

Your task is to produce the list of shipments that fulfill all the orders with the minimum effort for the shipment.

That means that you should have minimum number of unique pairs of location and destination in your result.

Sample answer for input data is:

LOCATION DESTINATION SKU AMOUNT
Gliwice Sydney prod-1 10
Munich Sydney prod-1 4
Gliwice Sydney prod-2 10
Munich Sydney prod-3 4
Gliwice Tokyo prod-2 2
Munich Tokyo prod-2 4
Montreal Tokyo prod-4 5
In this answer the number of unique pairs of location and destination is 5 (Gliwice-Sidney, Gliwice-Tokyo, Munich-Sidney, Munich-Tokyo, Montreal-Tokyo).




When you are ready please send the project with your implementation to
piotr.bochynski@hybris.com

 

We have already prepared the java project that you should extend:
https://bitbucket.org/
hybris/technology-internship


You can clone this mercur-
ial repository or directly
download it using this link:
https://bitbucket.org/
hybris/technology-internship/get/tip.zip


Please provide the implementation of the
Order Fulfillment interface
in the class Order Fulfill-
ment Service.


When you've completed
the task, please send us
the project with your implementation: