Git Product home page Git Product logo

applausecodesample's Introduction

Sample code for coding challenge

"User" Interface:

  • There is no GUI/WebUI for this sample code.
  • It is driven completely on HTTP GET requests.
  • When started, the web service listens on port 8080
  • The URL to access the code is: http://localhost:8080/match
    • This will perform a match for ALL countries and ALL devices

    • The output can be reduced by passing in values for the "country" and "device" as query parameters EXAMPLE: http://localhost:8080/match?country=ALL&device=ALL

      The returns the same value as the default query. Other examples:

       http://localhost:8080/match?country=US
       http://localhost:8080/match?country=US,JP
       http://localhost:8080/match?country=US,JP&device=1
       http://localhost:8080/match?device=1
       http://localhost:8080/match?device=1,2,3
       http://localhost:8080/match?device=1,Nexus 4
                 - Yes, devices can be input by ID or by description
      

      On error (invalid device or country, you get an error message)

  • All data returned is in a JSON structure. When there is no error, "rankings" contains an ordered array of tester and the number of bugs they've found that match the criteria

Code Structure src/main/java demo : Two classes that drive this Spring Application demo.dao : The POJOs send back as a response and the data objects we model. This is a little messy and I'd refactor this for production demo.datastore : The "datastore". It's all file based (for production, I'd use a RDBMS)

src/main/resources application.properties : Set these to control behavior data : The directory where the data is stored and read

Building

  • To build this you need Maven (version 3.3.9 or latter) and Java 8 or latter
  • To build: mvn install
  • To run (from this directory): java -jar target/applause-0.0.1-SNAPSHOT.jar (I don't have the locating the data files down to a science, so data loading depends on the current working directory)

applausecodesample's People

Watchers

Jim West 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.