Code Monkey home page Code Monkey logo

code-puzzle's Introduction

Build a Web API

A Runa customer, AwesomeShoes.com, needs a new report. They've given us their session data, which is a pipe delimited formatted file. Runa also has data stored in a CSV formatted file. The report should compare the data in the 2 files, and builds a report which shows the discrepancies.

Requirements

  • You need to create a web service, which has a single route, which generates a report as described in the expected api response.

API route:

  • /runatic/report - route which returns the report data. It takes a parameter order_by, which can be any of these 3 values
    • session-type-desc - sort by session-type in descending order
    • order-id-asc - sort by order-id in ascending order
    • unit-price-dollars-asc - sort by unit-price-dollars in ascending order
      This file has the above 3 use cases.

Caveats:

  • DO NOT use a library to parse any file. Use only clojure.core functions. (You CANNOT use String methods or libraries like clojure.string, clojure.set to parse the file, but you CAN use java methods to parse numbers etc). Don't worry about the edge cases of parsing the CSV/PSV files. Just do enough to parse the 2 files. For any of the non-parsing parts of the application you are free to use any libraries you want (from Clojars or Maven Central, etc). Email [email protected] if you're not clear about this.
  • Notice the order of the columns in the Runa data file, and the Merchant data file are different, and the prices in the Runa data file are in cents, while the prices in the Merchant file are in dollars.

Inputs

Outputs

Look at this file - expected api response

Solution Submission

Fork the project, and send an email to [email protected] once you're done.
There are no points given for speed, so please take as much time as you desire,
so that you can submit your best work.
Please include instructions for how to run your application and any tests.

Have fun! :)

My Stuff

Prerequisites

You will need Vagrant installed.

To initialize things

$ vagrant up

Running the server

$ ./go lein ring server-headless

Running tests

$ ./go lein test

code-puzzle's People

Contributors

alexbaranosky avatar charltonaustin avatar punitrathore avatar

Watchers

 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.