karanrjhaveri / recruitment-task

Recruitment task

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recruitment task :: Documentation

  • Karan Jhaveri

This project was done twice using 2 different programming languages:

  • Python
  • PHP

This application examines data stored in xml, yml or csv format files to produce a sum of the 'value' attribute.

Example Parameters for Script:
(Python)

  • python script.py --input data/file.yml
  • python script.py --input data/file.xml --output results/results.txt
    (PHP)
  • php script.php --input data/file.csv
  • php script.php --input=data/file.yml --output=results/results.txt

2 inputs are taken:
--input is Mandatory and --output is Optional

If no output argument supplied, the output prints to stdout .

Functional Test:
(Python)

  • python test.py
    (PHP)
  • php test.php

Results:

  • 'recorded results' folder shows all the results from each run
  • The sub-folders are segmented by input file-type

Steps Performed (Log):-

(Python)

  1. Install Python v.3
  2. Open Command-line
  3. Run Commands: a. Navigate to the script's directory: 'cd /d D:..\Github\recruitment-task\Python'
    b. Install the necessary packages for this project using pip
  • csv
  • xmltodict
  • argparse
  • yaml
  1. Completed script.py
  2. Functional tests conducted using test.py
    (PHP)
  3. Install Xampp
  4. Add PHP binary to Path (https://www.youtube.com/watch?v=neBVQBL_2P0)
  5. Installed Composer: https://getcomposer.org/download/
  6. Install Symfony: a. Navigate to script's directory via Command-line
    b. 'composer require symfony/symfony' (or alternatively 'compser require symfony/yaml')
  7. Completed script.php
  8. Functional tests conducted using test.php

Development Strategy:

  • Create code stub and roughly flesh out the idea
  • Break each functionality of the application into smaller modules.
  • Test each module independently and after including in the script
  • Once script was complete, made a test script that validates the output of the main script

About

Recruitment task


Languages

Language:Python 57.1%Language:PHP 42.9%