Giter Site home page Giter Site logo

products-near-you's Introduction

Products Near You

The purpose of this exercise is to build an API that returns the most popular products from shops near you.

Provided goodies

  1. A server boilerplate using Flask. To run the server:
$ python runserver.py
  1. A rudimentary client so you can visualize the results more easily. The client does not have any way to communicate with the API so you will need to implement that. To run the client:
$ cd client
$ python -m SimpleHTTPServer
  1. Four datasets in CSV format:
    • shops.csv: shops with their coordinates
    • products.csv: products per shop along available quantity and global popularity
    • tags.csv: a bunch of tags
    • taggings.csv: what tags each shop has

What you need to do

  1. Create a Python virtualenv and install the requirements:

    $ pip install virtualenvwrapper
    $ mkvirtualenv
    $ pip install -r requirements.txt
    
  2. Implement the Searcher.search() method in the client so it can communicate with your API. We've included jQuery on the page so you can use that if you like.

  3. Build the /search endpoint which returns the N most popular products across all shops near the user. The endpoint should receive:

    1. the number (N) of products to return
    2. a pair of coordinates (the user position)
    3. a search radius (how far the search should extend)
    4. optionally, some tags (what types of shops the user wants to see)

    If tags are provided, a shop needs to have at least one of them to be considered a candidate. You can use any Python library to your aid but you can't use any external databases or search engines (e.g PostGIS, Elasticsearch, etc). You should build your solution as if the data is static and cannot be updated by any external processes.

  4. Write some tests. A test foundation is provided for you in tests/conftest.py.

  5. Briefly think about and answer the questions in THOUGHTS.md.

You should deliver your solution as a git repository, preferably hosted on GitHub.

Things we look for

In a nutshell we're looking for correctness, good code design and sensible choices when it comes to performance. Imagine that your API will be used by a lot of people โ€“ how does that affect your design? Also, imagine that your code will be read by other developers in your team โ€“ keep them happy :-)

Resources

  1. Flask: http://flask.pocoo.org/
  2. pytest: http://pytest.org/latest/
  3. virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/en/latest/

products-near-you's People

Contributors

tjphopkins avatar

Watchers

Alex Michael avatar James Cloos avatar  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.