Git Product home page Git Product logo

coding-challenge-backend-c's Introduction

Busbud Coding Challenge

Requirements

Design an API endpoint that provides autocomplete suggestions for large cities. The suggestions should be restricted to cities in the USA and Canada with a population above 5000 people.

  • the endpoint is exposed at /suggestions
  • the partial (or complete) search term is passed as a query string parameter q
  • the caller's location can optionally be supplied via query string parameters latitude and longitude to help improve relative scores
  • the endpoint returns a JSON response with an array of scored suggested matches
    • the suggestions are sorted by descending score
    • each suggestion has a score between 0 and 1 (inclusive) indicating confidence in the suggestion (1 is most confident)
    • each suggestion has a name which can be used to disambiguate between similarly named locations
    • each suggestion has a latitude and longitude
  • all functional tests should pass (additional tests may be implemented as necessary).
  • the final application should be available publicly. You can use any hosting solution of your choice (Heroku, GCP, etc.).
  • feel free to add more features if you like!

Sample responses

These responses are meant to provide guidance. The exact values can vary based on the data source and scoring algorithm.

Near match

GET /suggestions?q=Londo&latitude=43.70011&longitude=-79.4163
{
  "suggestions": [
    {
      "name": "London, ON, Canada",
      "latitude": "42.98339",
      "longitude": "-81.23304",
      "score": 0.9
    },
    {
      "name": "London, OH, USA",
      "latitude": "39.88645",
      "longitude": "-83.44825",
      "score": 0.5
    },
    {
      "name": "London, KY, USA",
      "latitude": "37.12898",
      "longitude": "-84.08326",
      "score": 0.5
    },
    {
      "name": "Londontowne, MD, USA",
      "latitude": "38.93345",
      "longitude": "-76.54941",
      "score": 0.3
    }
  ]
}

No match

GET /suggestions?q=SomeRandomCityInTheMiddleOfNowhere
{
  "suggestions": []
}

Non-functional

  • All code should be written in Javascript or Typescript.
  • Mitigations to handle high levels of traffic should be implemented.
  • Challenge is submitted as pull request against this repo (fork it and create a pull request).
  • Documentation and maintainability is a plus.

Dataset

You can find the necessary dataset along with its description and documentation in the data directory.

Evaluation

We will use the following criteria to evaluate your solution:

  • Capacity to follow instructions
  • Developer Experience (how easy it is to run your solution locally, how clear your documentation is, etc)
  • Solution correctness
  • Performance
  • Tests (quality and coverage)
  • Code style and cleanliness
  • Attention to detail
  • Ability to make sensible assumptions

It is ok to ask us questions!

We know that the time for this project is limited and it is hard to create a "perfect" solution, so we will consider that along with your experience when evaluating the submission.

Getting Started

Prerequisites

You are going to need:

  • Git
  • nvm (or your preferred node version manager)
  • Node.js

Setting up your environment

  1. Begin by forking this repo and cloning your fork. GitHub has apps for Mac and Windows that make this easier.

  2. Install nvm or your preferred node version manager.

  3. Install Node.js.

Setting up the project

In the project directory run:

nvm use
npm install

Running the tests

The test suite can be run with:

npm run test

Starting the application

To start a local server run:

npm run start

it should produce an output similar to:

Server running at http://127.0.0.1:2345/suggestions

coding-challenge-backend-c's People

Contributors

blemoine avatar cdnbacon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coding-challenge-backend-c's Issues

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.