Coder Social home page Coder Social logo

cazana_test's Introduction

Cazana Task

Usage

Prerequisites

You will need to have NodeJS (version >= 12.13) and npm (version >= 6.14). Using previous versions does not guarantee that the program will run correctly as it uses some ES2018 methods which have only been available in the latest versions of Node (e.g. Array.pototype.flat()).

Installation

First, you will need to install the dependencies. From the command line run:

npm install

Running the tests

According to the task instructions, the program runs through the unit tests created using Jest. To run them, use the command:

npm test

Assumptions

  • The first-registration-date field ONLY refers to the specific VRM and NOT the registration date at first purchase. This implies that one has to check if the specific car has any prior vrm-change events in its timeline in order to gather the entire car's timeline.

  • The timeline array of events of a specific car, can contain AT MOST ONE vrm-change event indicating the previous VRM and ONE vrm-change event indicating the next VRM. This reduces the data duplication (by avoiding the storage of the same events multiple times) and also allows for the timeline of a car to be modeled as a directed graph that can be traversed using the VRM as the key: Each vehicle only 'knows' about its direct ancestor and successor.

  • When calculating the average-mileage, only the latest two events are used, and the rest are ignored. The decision was based on data found here which shows that there is a decreasing trend in the annual mileage of vehicles over the last few years. This makes older mileage values less reliable estimators of the current average mileage.

cazana_test's People

Watchers

James Cloos avatar  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.