Coder Social home page Coder Social logo

assessment-travel-compensation's Introduction

Assessment: Travel Compensation

This is a very naive implementation of an assessment regarding travel cost compensation. As a lot of information is not specified, I've made some assumptions. These assumptions are listed in the Known issues section.

Requirements

  • PHP 8.3

Setup

  1. Clone the repository
  2. Run composer install
  3. Run bin/console app:calculate-compensation
  4. The output file should be generated as compensation.csv

Rationale

This is a very simple Symfony CLI application for the specific purpose of an assessment. More code to put the same hard-coded data into a database and retrieve it from there would be overkill.

Tests

Not included for the sake of not being paid to do this assessment. Note: tests would have added value when specific working days are specified, as that would enable actually calculating the compensation for each month. See the next section for more information.

Known issues and caveats

The assessment makes note of the fact that employees who travel over 10 kilometers one-way prefer a different way of commuting. However, one case is mentioned in the data where an employee travels 11 kilometers one-way by bike. This is not taken into account, as it's not specified what the preferred way of commuting is.

An assumption is made that every traveled kilometer between 5 and 10 is compensated double as per the description of the assessment.

As it's not specified which weekdays employees are working, the average for each week is taken. No national holidays have been taken into account. Time off is not taken into account as that data was not available. Compensation is not adjusted for half-days, meaning that if an employee works 4 hours on a day, they will be compensated for the whole trip just as any other day.

Without specific data on which days are worked, it's impossible to accurately calculate the compensation for each individual month. Thus, the only sane way to do this is to calculate the average compensation per week and multiply that by 52, then divide that by 12 to get the average for each month. This is expected to be inaccurate for any real-world scenario.

One last assumption is that the travel compensation is paid in full, for each day worked. This means the distance is multiplied by 2, as the employee has to travel to and from work.

assessment-travel-compensation's People

Contributors

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