GithubHelp home page GithubHelp logo

graph-algorithms-exercise's Introduction

Background

Shypple is a freight forwarder company. That means we help other companies to get their products from one place to another. We must deliver the goods as fast as possible. To achieve that, we need to replace some human labor with automation. We have part of the process being done via Excel and that is not good to scale.

Have we told you we want to be the biggest freight forwarder company in the world?

The good news is the team MapReduce (yeah, they choose this name) already created a service that aggregates lots of information and returns a JSON file for us. This MapReduce service returns all shipping options available in the database. We have given you a sample JSON response from MapReduce service.

Your job is to create a small service that does some calculations using the JSON file.

Exchange rates in the JSON file are based on EUR (For example 2022-01-29 usd rate 1.1138 is USD/EUR rate). We decide which exchange_rate will be used to calculate EUR sailing rate based on the departure_date of the sailing. Use sailing_code from sailing & rate to get the rate amount & currency.

Your Product Owner created 3 tickets for you: 3rd task(TST-0003) is a nice to have feature. So it is a bonus task & you can finish it if you have time.

(1) PLS-0001 - Acceptance criteria: Return the cheapest direct sailing between origin port & destination port in following format. For example using CNSHA as origin port & NLRTM as destination port input parameters

[
  {
    "origin_port": "CNSHA",
    "destination_port": "NLRTM",
    "departure_date": "2022-02-01",
    "arrival_date": "2022-03-01",
    "sailing_code": "ABCD",
    "rate": "589.30",
    "rate_currency": "USD"
  }
]

(2) WRT-0002 - Acceptance criteria: Return the cheapest sailing (direct or indirect). If the cheapest one contains more than one sailing (two sailings) in the following format, you should return all sailing legs (You need to compare the sum of all sailing legs to find the cheapest sailing option). Use same CNSHA as origin port & NLRTM as destination port input parameters

[
  {
    "origin_port": "CNSHA",
    "destination_port": "ESBCN",
    "departure_date": "2022-01-29",
    "arrival_date": "2022-02-06",
    "sailing_code": "ERXQ",
    "rate": "261.96",
    "rate_currency": "EUR"
  },
  {
    "origin_port": "ESBCN",
    "destination_port": "NLRTM",
    "departure_date": "2022-02-16",
    "arrival_date": "2022-02-20",
    "sailing_code": "ETRG",
    "rate": "69.96",
    "rate_currency": "USD"
  }
]

(3) TST-0003 - Acceptance criteria: Return the fastest sailing legs (direct or indirect) in the same above format

As those are small changes, we can create one branch for all the changes.

You should provide a solution that make possible to scale because new requirements will come soon.

  1. SLD-0004 - coming soon
  2. DRY-0005 - coming soon
  3. TDD-0006 - coming soon

We will evaluate the solution with some criteria:

  1. Object Oriented Concepts
  2. SOLID
  3. DRY
  4. Test Coverage

Lingo

CNSHA - Shanghai

NLRTM - Rotterdam

ESBCN - Barcelona

BRSSZ - Santos

Shipment Leg: A "shipment leg" refers to each segment of a shipment's journey between two specific locations, such as from one port to another. For example, if a shipment travels from Shanghai to Rotterdam with a stopover in Barcelona, the journey consists of two legs: Shanghai to Barcelona and Barcelona to Rotterdam.

We are here to help

Feel free to reach out to us with any questions or concerns you may have. We're here to help and are more than happy to provide any clarification needed.

Good luck!

:q!

graph-algorithms-exercise's People

Contributors

piotrekpasciak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.