Skip to content

Instantly share code, notes, and snippets.

@auzwang
Last active December 13, 2019 06:21
Show Gist options
  • Save auzwang/df967d17b5e366df07e2c0821aaf6bac to your computer and use it in GitHub Desktop.
Save auzwang/df967d17b5e366df07e2c0821aaf6bac to your computer and use it in GitHub Desktop.
Localz Driver Tracker Challenge

Localz Driver Tracker

Localz is building a platform to track driver locations as they deliver parcels.

A driver logs into their device and begins submitting location. This location will be used for the customer to track the driver on a map.

Requirements

Please conform to the requirements below, we do not expect you to go beyond these. This is a server-side challenge.

  • Tests
  • Use either MongoDB or Postgres
  • REST interface
  • Request validation
  • Driver-Location relationship
    • Locations are associated with a driver via a session
    • Locations are submitted to a session
    • Sessions store a list of locations
    • A sessions is created when a driver logs in
    • A session becomes inactive when a driver logs out
    • A driver can only have a single active session
  • It should be possible to:
    • List locations for a driver's active session
    • List historical sessions for a driver along with their locations
    • List drivers
    • Submit a location for a session
    • Search driver by name
    • Retrieve a driver by driver ID
    • For a driver to:
      • login
      • logout
  • You are not expected to implement authentication or authorisation
  • You can assume drivers are already registered in the system and logs in via their id
  • README documenting:
    • Your approach to the problem
    • How to run your code
    • How to test

Entities

  • Driver

      {
        "id": "bfabf30b-c3c9-4940-8af8-f27a49a1114f",
        "firstName" : "Bob",
        "lastName": "Dylan"
      }
    
  • Location

      {
        "latitude": -37.61381,
        "longitude": 144.6660788,
        "timestamp": "2019-09-23T13:40:44+10:00"
      }
    

Tips

  • Store location in an efficient way. Many databases have types like GeoJSON.
  • Think about issues you might have with scaling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment