Git Product home page Git Product logo

test-bds's Introduction

Test task

For a given csv-file find the one second-window during which the largest number of trades took place. Do the same considering trades for each exchange separately.

The input file is passed as a program argument.

Output based on given file:

Максимальное количество сделок в течение одной секунды было между 10:02:00.735 и 10:02:01.735. В этот интервал прошло 516 сделок.
Максимальное количество сделок на P в течение одной секунды было между 10:14:23.576 и 10:14:24.576. В этот интервал прошло 55 сделок.
Максимальное количество сделок на Q в течение одной секунды было между 10:02:00.184 и 10:02:01.184. В этот интервал прошло 243 сделок.
Максимальное количество сделок на B в течение одной секунды было между 10:13:00.435 и 10:13:01.435. В этот интервал прошло 11 сделок.
Максимальное количество сделок на D в течение одной секунды было между 10:02:00.785 и 10:02:01.785. В этот интервал прошло 47 сделок.
Максимальное количество сделок на V в течение одной секунды было между 10:12:01.057 и 10:12:02.057. В этот интервал прошло 9 сделок.
Максимальное количество сделок на X в течение одной секунды было между 10:02:00.780 и 10:02:01.780. В этот интервал прошло 9 сделок.
Максимальное количество сделок на Y в течение одной секунды было между 10:09:54.386 и 10:09:55.386. В этот интервал прошло 12 сделок.
Максимальное количество сделок на J в течение одной секунды было между 10:09:54.386 и 10:09:55.386. В этот интервал прошло 8 сделок.
Максимальное количество сделок на Z в течение одной секунды было между 10:02:00.632 и 10:02:01.632. В этот интервал прошло 43 сделок.
Максимальное количество сделок на K в течение одной секунды было между 10:02:00.632 и 10:02:01.632. В этот интервал прошло 133 сделок.

Main concept

Add every trade in a queue while the difference between the head element and the new element is less than 1 second. Otherwise, get the current queue size and pop the elements until the difference becomes less than 1 second again.

The same logic is applied to all queues (the general one and per exchange)

test-bds's People

Watchers

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