Giter VIP home page Giter VIP logo

stone-technical-test's Introduction

Stone Technical Test

Technical test for data engineering manager role

Requirements

This script should run on any Ubuntu machine (inlcuding from AWS) that has Docker installed. To install docker on your machine, please visit docker installation tutorial.

If docker is installed than clone this repository and move to the root directory of the project:

git clone https://github.com/tobiasveiga/stone-technical-test.git
cd stone-technical-test

1) Download data

The raw data should be located in database/data. If neccessary you can download the data with the download script by running ./tools/download_data.sh.

2) Setup

First start Postgres and Python container with ./tools/start_containers.sh To prepare everything, run the script ./tools/setup.sh. This script will:

  • add schemas to the DB
  • install python requirements
  • preprocess the data
  • feed the processed data to the DB

3) Analyze

Run the python script tools/generate_analysis.py:

docker exec -it py3 python tools/generate_analysis.py

or enter the container and run the script from there:

docker exec -it py3 /bin/bash
python tools/generate_analysis.py

Outputs of the analysis will be located in output/.

Storytelling Analysis.html file can be found in the root of this project. (NOTE: use Google Chrome browser to visualize this file!)

Notes

Programming choices

- Docker network configuration

Ideally I would use --network host configuration in both containers for faster perfomance but this in only available on Linux and I had only available a Windows machine to develop.

- Data preprocessing

The data preprocessing ignore two fields with null data ang normalize the payment_type field to speed up analysis later.

It also changes the JSON data to CSV data. I have chosen this because Postgres can copy CSV data very fast to the DB. This choice also makes sense because although data was in JSON format, it was clearly relational data (and I am supposed to use SQL in this task).

And in a different context, I would use a C script to convert that JSON files into CSV, but I used python because of the task requirements.

Entering the docker containers

  • Postgres container: docker exec -it postgres /bin/bash
  • Python container: docker exec -it py3 /bin/bash

stone-technical-test's People

Contributors

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