Coder Social home page Coder Social logo

query-bids's Introduction

#query-bids (practice assignment)

##How to run:

Open up src/index.html in browser and refer on-screen mini walk-through or:

Generate dummy bids:

var bids = new BidsGenerator().generate(); // generate() also accepts a number

Instantiate BidsQuery:

var q = new BidsQuery(bids);

Query bids:

q.getBidsByLastUpdated(5); //get latest 5 bids by updated date

OR

q.getBidsByLastExecuted(5); //get latest 5 bids by executed date

Bonus:

getBidsByLastUpdated and getBidsByLastExecuted methods of BidsQuery accept filter name as second parameter.

q.getBidsByLastUpdated(5, 'foo'); // filter foo tag

##Assumptions:

  1. Firing Ajax requests is not required and is out of the scope. The solution directly works with bids array.
  2. The problem statement mentions JavaScript solution and UI isn't mentioned so I have created minimal UI to drive the JavaScript code.
  3. Bids need to be sorted based on recent dates i.e. select latest n bids.
  4. Relatively newer browser is used for testing, such as IE9 and onwards.

##Areas for improvements

  1. As this assignment is for UI developer, build a complete working UI implementation to accept bids, process bids and display on the screen.
  2. Sorting function used in BidsQuery is not guaranteed to be stable sort in all browsers. Implement custom sorting function e.g. merge sort.

query-bids's People

Watchers

Peeyoosh Sangolekar 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.