Git Product home page Git Product logo

propine-challenge's Introduction

propine-assignment

Propine Blockchain Engineer Assignment

Questions

We're looking at your programming ability. It must not only work, it should be maintainable.

Let us assume you are a crypto investor. You have made transactions over a period of time which is logged in a CSV file. Write a command line program that does the following

  • Given no parameters, return the latest portfolio value per token in USD
  • Given a token, return the latest portfolio value for that token in USD
  • Given a date, return the portfolio value per token in USD on that date
  • Given a date and a token, return the portfolio value of that token in USD on that date

The CSV file has the following columns

  • timestamp: Integer number of seconds since the Epoch
  • transaction_type: Either a DEPOSIT or a WITHDRAWAL
  • token: The token symbol
  • amount: The amount transacted

Portfolio means the balance of the token where you need to add deposits and subtract withdrawals. You may obtain the exchange rates from cryptocompare where the API is free. You should write it in Node.js as our main stack is in Javascript/Typescript and we need to assess your proficiency.

Usage

  • Change .default.env to .env and check environment variables

  • Install all missing package by run this command blow in terminal

yarn
  • At the project's root, in terminal run application by
node .
  • For unit test run by
yarn test

Project directories

├── LICENSE
├── main.js
├── package.json
├── README.md
├── src
│  ├── api
│  │   └── currency.js
│  ├── constants
│  │   └── constants.js
│  ├── services
│  │   ├── parse-content.js
│  │   ├── read-file.js
│  │   └── transaction.js
│  └── utils
│      ├── color.js
│      ├── menu.js
│      └── time-convert.js
├── test
│   ├── init-chai.js
│   ├── mocks
│      └── transactions-100.csv
│   ├── transaction.test.js
│   └── time-convert.test.js
└── .default.env

Thing need to improve

  • Speed up processing large data from parse file to get some object transformation

    • Apply thread, child process while processing data
    • Snapshot while reading (by time range) => using redis cached and from now, read from cache
  • Update unit test to cover all functions and missing case

propine-challenge's People

Contributors

henry0hai avatar

Watchers

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