GithubHelp home page GithubHelp logo

interview-exercise's Introduction

Developer Programming Exercise

User Story

As a trader I want to be able to monitor stock prices such that when they breach a trigger level orders can be executed automatically.

Note:

The implementation of PriceSource and EecutionService is out of scope, assuming that it will be provided by third party. You need to listen to price updates from PriceSource and act accordingly.

Exercise

Given the following interface definitions (provided)

public interface ExecutionService {
    void buy(String security, double price, int volume);
    void sell(String security, double price, int volume);
}
public interface PriceListener {
    void priceUpdate(String security, double price);
}
public interface PriceSource {
    void addPriceListener(PriceListener listener);
    void removePriceListener(PriceListener listener);
}

Develop a basic implementation of the PriceListener interface that provides the following behaviour:

  1. Monitors price movements on a specified single stock (e.g. "IBM")
  2. Executes a single "buy" instruction for a specified number of lots (e.g. 100) as soon as the price of that stock is seen to be below a specified price (e.g. 55.0). Don’t worry what units that is in.

Considerations

  • Please "work out loud" and ask questions
  • This is not a test of your API knowledge so feel free to check the web as reference
  • There is no specific solution we are looking for

Some libraries already available:

  • Java 8
  • JUnit 4
  • Mockito
  • EasyMock
  • JMock

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.