Python Assessment

Python Test

/src/python_basics.py file contains two functions.

  1. square_list
  2. weighted_sum

The task is to write implementation of these two functions. Once the implementation is done, use pytest to validate if your answers were correct.

The instruction for implementation of each function is contained inside the doc string of the same function.

Do not modify the any other file in the repo when submitting the result.

SQL Test

/src/sql_basics.py file contains two functions.

  1. group_by_and_aggregate
  2. join_dataframes

The task is to write implementation of these two functions. Once the implementation is done, use pytest to validate if your answers were correct.

The instruction for implementation of each function is contained inside the doc string of the same function.

Do not modify the any other file in the repo when submitting the result.

A note about grading

Each question carry equal weight in terms of marks. Total marks is 100. For each failing test, 25 marks are deducted from the total. We expect you to get 75 marks to pass this stage.

How to get started

The code requires python 3.x.x to run.

  1. Clone the repo by running

git clone https://github.com/zainulabidin302/python-assessment.git

from command line or download the zip of the code from the same url.

  1. (Optional) Create a conda or virtualenv and activate it.
  2. Install the requirements with

pip install -r requirements.txt

  1. For conda users: install dependencies with

conda install --yes --file requirements.txt

  1. Implement the solution. Take a closer look at the doc strings for details of implementation.
  2. Run pytest to verify all the code is running.
  3. In root directory, run

python src/submit.py <your-email-address>

(Notice: Step 7 command will send your solution to our servers for grading and informing HR. Make your tests are passing with pytest before sending your solution. You only have 3 attempts.)