Flexport | Phone interview | Senior Software Engineer | Amsterdam, April 2023
Anonymous User
975

Part 1
Imagine you have a shipments, that can consist of following fields:

  • weight
  • volume
  • crewSize

and a rate for calculating shipment cost. Rate can be only applicable to the one of the values in the shipment. Having that said - write a function for calculating the total cost for the shipment.

Example:
Shipment consist of weight 10kg and the rate for 1kg is 5

Part 2:
We now want to make rates more flexible and provide a rate based on the amount of the shipment items.
Example:
if the volume of the shipment is less than 10 cubic meters then rate is 9 per 1 cubic meter
if the volume is more than 50 – rate is 4$ per 1 cubic meter

For a shipment with volume of 40cbm the rate would be calculated as following: 40*5 = 200

Unfortunately I was running out of time and did not see part 3

Comments (1)