Skip to content

Instantly share code, notes, and snippets.

@omeroot
Last active May 18, 2020 12:41
Show Gist options
  • Save omeroot/cfae48d1e1a2a2d4a04e329428b085a5 to your computer and use it in GitHub Desktop.
Save omeroot/cfae48d1e1a2a2d4a04e329428b085a5 to your computer and use it in GitHub Desktop.

Markakod Interview Project

We are going to prepare a few simple endpoints where we can monitor where a traveler is walking around in the day and where they have been most recently.

Basic frameworks to be used etc...

  • MongoDB (MongooseJS as adapter)
  • Expressjs
  • Typescript (Optional)

** You need to manually create an example travaler object on mongodb traveler collection **

Example:

{
 name: 'Markakod',
 lastLocation: []
}

Collection Information

Traveler Collection :
  • name : String
  • lastLocation : Array (coordinates lat, lng)
Routes :
  • traveler id: Reference
  • lastLocation : Array (coordinates lat, lon)
  • createdAt

Data

You need to define an endpoint on expressJS and POST the location information of the traveler to this endpoint (lat, long). with another endpoint, we can pull the locations into an array.

Example endpoints

//get traveler daily routes
[GET] localhost:5556/api/v1/summary/:TRAVELER_ID

//get traveler last location
[GET] localhost:5556/api/v1/traveler/route/:TRAVELER_ID

//new traveler coordinate

[POST] localhost:5556/api/v1/coordinate
[BODY] => {
  	"travelerId": "587e96c27ffdcf1cfb2ce5d4",//traveler id for new location
  	"coordinate": [41.001759, 29.095316] //traveler current location (lat, long)
}

Goals

What is expected is mainly the use of express, the use of asynchronous block, template engine working logic and using ORM. You do not have to work for the UI to look.

Submission

You should create a repository on any git services (github, bitbucket etc...) and you can send an email with the url of your repository after you finished the challange.

If you have any other questions about the challange project feel free to contact with omer.demircan@markakod.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment