Coder Social home page Coder Social logo

candidate-test-task's Introduction

candidate-test-task

A task meant to test Divly Python developer candidates

Parsing transactions from CSV

A common task and recurring tasks is to build integrations for importing transactions via csv files from crypto exchanges. The CSV files are similar in how they list transactions but often have different ways of representing transactions and the data within them. Some transactions are listed on one row, some on two or more. It's your job to design and build a parsing design that can read and output the two provided example csv files which represenets two real files from two different crypto exchanges. How a transaction is read isn't always obvious and how well you figure this out is part of the assesment in the test.

Note that the amounts and values are made up and does not reflect actual currency values of the dates they were made.

Input

The CSVParser class takes a path to a csv file as input.

Requirements

  • You must use Python 3.x
  • You must use the pandas library
  • You must be able to parse all existing transactions in the the two different example files.
  • The CSVParser class must be used for printing the results as already written in main.py. Aside from that you may design and structure other functions, classes or data structures exactly how you see fit and think is best. Your design choices are at the core of how we evaluate your test.

Expected output backend

To store a transaction in the database the output needs to be in json as below. For each transaction that is parsed, the expected output should be in json as the below for each of the transactin types. You may show the results by returning a list of JSON objects in a method called get_json_results() in the CSVParser class found in main.py. Note that there are three different transaction types and how they differ in their output format is shown below.

Example output from backend

Trade:

{
    'date':'yyyy-mm-dd HH:mm',
    'transaction_type':'Trade',
    'received_amount': 20
    'received_currency_iso': 'BTC'
    'sent_amount': 100
    'sent_currency_iso': 'USD'
}

Deposit:

{
    'date':'yyyy-mm-dd HH:mm',
    'transaction_type':'Deposit',
    'received_amount': 20,
    'received_currency_iso': 'BTC',
    'sent_amount': null,
    'sent_currency_iso': null,
}

Withdrawal:

{
    'date':'yyyy-mm-dd HH:mm',
    'transaction_type':'Withdrawal',
    'received_amount': null,
    'received_currency_iso': null,
    'sent_amount': 20,
    'sent_currency_iso': 'BTC',
}

Front-end task

  • Build a component using VueJS displaying the transactions with all their information that is returned by get_json_results()
  • You may use any tool or Vue component library to desing and style it.

Transaction types

transaction_type is a text string and must be one of these three in the output:

  1. Trade - One currency is traded for another currency in an account.
  2. Deposit - An increase of crypto to an account.
  3. Withdrawal - A decrease of crypto to n account.

What we asses in your code test:

Backend

  • How well your chosen design the parser for scale
  • How easy the design and code is to understand
  • How well the design works if we would like to add more files in the future.
  • How well you understand how transactions should be interpreted without explicit instructions on what the file lists (as it will be in the real world.)
  • How Pythonic the code style is (not super important)

Front-end

  • We're interested in seeing how you would choose to display the transaction information and how you choose to make it look good and readable to the user.
  • The chosen structure of the component, and potential sub components will be assessed.
  • Overall UI design thinking and skills is taken into consideration.

Good luck!

candidate-test-task's People

Contributors

rubreh avatar farhapartex avatar

Watchers

James Cloos 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.