GithubHelp home page GithubHelp logo

xebia-france / extreme-carpaccio Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dlresende/extreme-carpaccio

2.0 16.0 3.0 1.33 MB

extreme startup + elephant carpaccio

C# 6.90% Clojure 2.21% Erlang 5.19% Groovy 1.77% Haskell 2.26% Shell 0.19% Java 18.89% JavaScript 49.53% Python 3.70% Racket 2.76% Scala 1.86% HTML 2.26% CSS 0.13% Go 1.25% Rust 1.09%

extreme-carpaccio's Introduction

Extreme Carpaccio

extreme startup + elephant carpaccio

Technical Instructions

  1. To be able to play, you will need to start an http server in your local machine. Many servers are already available in the clients directory, you only need to clone this repository and pick will. Otherwise, you can create your own http server.

  2. The organiser will start a central server which will send requests to each participant's server. Since the organiser communicates the URL for the server dashboard, go there and register your local server with your local IP address and the port under your http server is listening on (URL example: http://:/)

  3. The central server will start sending orders to your local client like this:

    POST /order HTTP/1.1
    {
        "prices": [65.6,27.26,32.68],
        "quantities": [6,8,10],
        "country": "IE",
        "reduction":"STANDARD"
    }
    
  4. Your job is to calculate the amount of the received orders and answer with a JSON object bill, i.e.: { "total": 1000.0 } (the server checks responses using two decimal digits of precision, so, i. e., 10.1234 and 10.12 are equal).

  5. Your score will be shown in the dashboard

  6. The server will send you feedback based on what you have responded. So check if your local http server already handles POST /feedback and, if not, implement it, otherwise you will not be able to figure out what is going on with your responses. Here is an example of a feedback the central server can send to you:

    POST /feedback HTTP/1.1
    {
        "type": "ERROR",
        "content": "The field \"total\" in the response is missing."
    }
    

Functional Instructions

To calculate the bill, you need to consider the tax of the country from which the order came from and the reduction.

Taxes

Here is the tax table used in the exercise:

Country Code Tax
Germany DE 20%
United Kingdom UK 21%
France FR 20%
Italy IT 25%
Spain ES 19%
Poland PL 21%
Romania RO 20%
Netherlands NL 20%
Belgium BE 24%
Greece EL 20%
Czech Republic CZ 19%
Portugal PT 23%
Hungary HU 27%
Sweden SE 23%
Austria AT 22%
Bulgaria BG 21%
Denmark DK 21%
Finland FI 17%
Slovakia SK 18%
Ireland IE 21%
Croatia HR 23%
Lithuania LT 23%
Slovenia SI 24%
Latvia LV 20%
Estonia EE 22%
Cyprus CY 21%
Luxembourg LU 25%
Malta MT 20%

For the order {"prices":[15.99],"quantities":[1],"country":"ES","reduction":"STANDARD"}, for example, the response should be {"total":19.03}.

Reductions

Following the STANDARD reductions applied for the most part of the orders:

Total Reduction

= 50 000 EUR | 15 % = 10 000 EUR | 10 % = 7 000 EUR | 7 % = 5 000 EUR | 5 % = 1 000 EUR | 3 %

For the order {"prices":[4.1,8.03,86.83,65.62,44.82],"quantities":[10,3,5,4,5],"country":"AT","reduction":"STANDARD"}, for example, the response should be {"total":1166.62}.

Note that:

  1. reductions are applied after the taxes;
  2. another reduction types can appear during the game. You need to stay tuned in the server's feedback to figure out how to calculate it.

Penalties and Cash

Note that if you answer something that does not match the expected bill, you will be charged with 10% of the amount of the right bill. If your answer is correct, you earn the total of the bill. If your answer does not match the expected object bill or is empty, no penalties are applied.

Have fun :)

extreme-carpaccio's People

Contributors

antoineroux avatar arnauld avatar bernardnotarianni avatar dlresende avatar gphilipp avatar jean-eudes avatar keraton avatar mdulac avatar radwane-h avatar seblm avatar

Stargazers

 avatar  avatar

Watchers

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