Giter Site home page Giter Site logo

cmo's Introduction

CMO Technical Interview

The Brief

Create a VAT calculator that shows a history of calculations requested that can be exported as a CSV file.

  • For user provided monetary value V and VAT percentage rate R, calculate and display both sets of calculations:
    • Where V is treated as being ex VAT show the original value V, the value V with VAT added and the amount of VAT calculated at the rate R.
    • Where V is treated as being inc VAT show the original value V, the value V with VAT subtracted and the amount of VAT calculated at the rate R.
  • The results from each requested set of calculations should be stored, and displayed on screen as a table of historical calculations.
  • The history should be able to be cleared and exportable to a CSV file.
  • Host your final code on a public git remote (github, bitbucket, etc) that we can access and ensure you have added a README file to document your specific files for us to review.

You are free to use your preferred stack, be it WAMP/MAMP or Docker with K8s etc. You must however ensure you use PHP7.4 - 8.2 and MariaDB.

Bonus points

  • Migrate or build your calculator on a Symfony project
  • Prevent against XSS & SQL injection

Prerequisites

  • PHP8
  • Composer
  • Symfony CLI

Getting started

  1. Install dependencies composer install
  2. Set up your .env file ensuring you have database credentials in there
  3. Create the database php bin/console doctrine:database:create
  4. Set up the database php bin/console doctrine:migrations:migrate
  5. Start the dev server symfony server:start and navigate to http://127.0.0.1:8000/

Running tests

  1. Create the database php bin/console doctrine:database:create --env=test
  2. Set up the database php bin/console doctrine:migrations:migrate --env=test
  3. Run the tests php bin/phpunit

To Enhance

  • Style the front-end
  • Add more tests

Comments

I've never used Symfony before. This took about half a day. Check out https://github.com/joebailey26/cmo/commit/fabbcf4a5f7e6ac44b4c331b03a15755b0f17152 for the files I actually changed. You can see a demo here https://cmo.joebailey.xyz

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.