Giter VIP home page Giter VIP logo

trip-calc-challange's Introduction

Structure

The project is structured as follows:

  • src/main/java/org/nixes/ contains the source code
  • src/test/java/ contains the tests

CSV Files

  • expected-trips-full.csv - The hand executed expected results when following all rules and assumptions
  • taps.csv - The input file provided in the task description
  • trips.csv - The output file generated by this program

Installation and Build

Depends on:

  • a java 21 JDK.
  • Apache Maven
mvn clean install

Execution

Run 'TripProcessCommand' with an input taps.csv in the working directory.

java -cp target\lp-trip-calc-1.0-SNAPSHOT.jar org.nixes.TripProcessCommand

Running tests

mvn test

Assumptions

  • The input file is in the correct format
  • The input file is in the working directory
  • The input file is named taps.csv
  • The case of fields in the input file is consistent with the example provided in the task description
  • The fare rule is as per the example provided in the task description
  • Fare rules do not change during the course of processing a file.
  • Cancelled/incomplete trips use the same from and to StopId
  • Cancelled/incomplete trips use the first DateTimeUTC as both the Started and Finished values
  • Assumed the names of the various trip statuses are "COMPLETED", "INCOMPLETE", "CANCELLED". Only COMPLETED was provided.

Issues/Observations

  • The DurationSecs in the example output seems incorrect. The difference in mins between the Started and Finished times is 5 mins which is 300 seconds. The originally provided output says 900 seconds.
  • The started and finished times in the example output do not match the relevant tap ids in the input taps.csv file
  • There are some cases of tap offs without tap ons in the example data. I have assumed that these should be considered as incomplete trips. But this would need to be confirmed with the business.
  • What is the cause of these isolated tapOffs, is there a data quality/consistency issue?

trip-calc-challange's People

Contributors

nixes 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.