Skip to content

konkked/interview-backend-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Challenge

This is the completed coding challenge for the outdoorsy staff engineer backend role.

Functionality

The rental api has the following functionality:

  • /rentals/<RENTAL_ID> Read one rental endpoint
  • /rentals Read many (list) rentals endpoint
    • Supported query parameters
      • price_min (number)
      • price_max (number)
      • limit (number)
      • offset (number)
      • ids (comma separated list of rental ids)
      • near (comma separated pair [lat,lng])
      • sort (string)
    • Examples:
      • rentals?price_min=9000&price_max=75000
      • rentals?limit=3&offset=6
      • rentals?ids=3,4,5
      • rentals?near=33.64,-117.93 // within 100 miles
      • rentals?sort=price
      • rentals?near=33.64,-117.93&price_min=9000&price_max=75000&limit=3&offset=6&sort=price

The rental object JSON in the response is as follows:

{
  "id": "int",
  "name": "string",
  "description": "string",
  "type": "string",
  "make": "string",
  "model": "string",
  "year": "int",
  "length": "decimal",
  "sleeps": "int",
  "primary_image_url": "string",
  "price": {
    "day": "int"
  },
  "location": {
    "city": "string",
    "state": "string",
    "zip": "string",
    "country": "string",
    "lat": "decimal",
    "lng": "decimal"
  },
  "user": {
    "id": "int",
    "first_name": "string",
    "last_name": "string"
  }
}

How to Run

  • make sure you have docker installed
  • run command docker compose up --build will build latest code and bootstrap the api
  • test using the http://localhost:8080/rentals/<id> and http://localhost:8080/rentals/?<query_string> endpoints (e.g. GET http://localhost:8080/rentals?ids=1,2,3&sort=lng&price_min=1&price_max=100000&limit=100&offset=1)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published