123Loadboard Code.Jam( )

Summary

Information about the project sponsored by 123Loadboard as part of the 13th Edition of McGill CodeJam 👾

Goal 🎯

Create a tool to notify truckers 🚚 of ideal loads 📦.

Context 📝

The job of a trucker is to move loads (i.e. merchandise, shipments) from location A to location B. Often, a trucker will use a load board (such as 123Loadboard™) to find loads to haul. A load board is an online marketplace for truckers to find loads. From all the loads available on the load board, truckers needs to select loads that fit their needs and preferences.

The process is tedious for a trucker. They just want to find the best and most profitable load quickly.

The challenge 🤔

Given the location and preferences for different truckers, develop a solution to notify truckers of the best new loads on the marketplace, while keeping the “noise” to a minimum.
Be creative!

Your Users 🧔

The solution you build will help drive trucker-oriented tools:

When searching for loads to haul, truckers try to find the optimal load across many dimensions. Here are some of their motivations.

Furthermore, when truckers are using tools to help them fulfill their motivations, the expect these tools to provide a good user experience. They want the tool to pick the best load for them easily. Acquiring a load takes time and effort. They don’t want to receive too many notifications, they just want the best.

Data 💾

The data is sent in the form of events. For the purpose of the CodeJam, the timestamps in the data span over a single day 📅. The events of the entire day are sent in an accelerated 🏍️ fashion within a ~5 minutes ⏱️ window.

In other words, every ~5 minutes, the day restarts and a new set of data is emitted. The data is partially randomized 🎲 each cycle.

The data is received by subscribing to an MQTT queue. Connection specifications are outlined below.

Once subscribed, you will receive 4 types of events.

This signals the beginning of a day. For the purposes of the code jam, you may want to wait for a start event before running your simulation.

This is when a new load is posted to the load board. The load is immediately available to any trucker who wants it. Each load event is a new load.
Mileage is in miles unit

This indicates the current GPS location of a truck. Multiple truck events can reference the same truck, in a given day. This would indicate that the truck is moving on the map.

nextTripLengthPreference is
Short - smaller than 200 miles
Long - 200 miles or bigger

equiptype is “Van”, “FlatBed” or “Reefer”

This signals the end of a day. You can end the simulation when you receive this event.

The structure of these events is presented below in the sample data.

MQTT Connection Info 📡

host: fortuitous-welder.cloudmqtt.com
port: 1883 (non SSL)
user: CodeJamUser
password: 123CodeJam

cleanSession: true  // important
QoS: 1
clientId: "<team name>01" // see important note below
Topic: CodeJam

CLIENTID MUST BE UNIQUE!!
Use your team name for the client ID. If you have multiple team members connecting at the same time, please add a number at the end unique to each member.
For example, if you are team of 3, then you might have the following client IDs:

If your client ID is not unique, you risk getting kicked out or losing messages!

Sample Data 🧪

Each message is a small json document.

🚀 Start
Setup data for a new “day” and ignore previous data

{
  "seq": 0,
  "type": "Start",
  "timestamp": "2023-11-17T03:00:00.00123-05:00"
}

🚚 First Truck, id: 114

{
  "seq": 1,
  "type": "Truck",
  "timestamp": "2023-11-17T08:06:23.0406772-05:00",
  "truckId": 114,
  "positionLatitude": 41.425058,
  "positionLongitude": -87.33366,
  "equipType": "Van",
  "nextTripLengthPreference": "Long"
}

🚛 Second Truck, id: 346

{
  "seq": 2,
  "type": "Truck",
  "timestamp": "2023-11-17T09:10:23.2531001-05:00",
  "truckId": 346,
  "positionLatitude": 39.195726,
  "positionLongitude": -84.665296,
  "equipType": "Van",
  "nextTripLengthPreference": "Long"
}

📦 Load, id: 101

{
  "seq": 3,
  "type": "Load",
  "timestamp": "2023-11-17T11:31:35.0481646-05:00",
  "loadId": 101,
  "originLatitude": 39.531354,
  "originLongitude": -87.440632,
  "destinationLatitude": 37.639,
  "destinationLongitude": -121.0052,
  "equipmentType": "Van",
  "price": 3150.0,
  "mileage": 2166.0
}

📦 Load, id: 201

{
  "seq": 4,
  "type": "Load",
  "timestamp": "2023-11-17T11:55:11.2311956-05:00",
  "loadId": 201,
  "originLatitude": 41.621465,
  "originLongitude": -83.605482,
  "destinationLatitude": 37.639,
  "destinationLongitude": -121.0052,
  "equipmentType": "Van",
  "price": 3300.0,
  "mileage": 2334.0
}

🚚 Truck, id: 114 (update position)

{
  "seq": 5,
  "type": "Truck",
  "timestamp": "2023-11-17T16:40:32.7200171-05:00",
  "truckId": 114,
  "positionLatitude": 40.32124710083008,
  "positionLongitude": -86.74946594238281,
  "equipType": "Van",
  "nextTripLengthPreference": "Long"
}

🛑 End
No more events for the day.

{
  "seq": 6,
  "type": "End",
  "timestamp": "2023-11-17T22:52:21.1572422-05:00"
}

Based on the above data, we can see the following: 🕵

Sample Data Map

Of course, in a real run, you will have many more truck and load events in the day. 😜

Naive Solution 😇

Based on the sample data, the most naive solution would be to notify both truckers immediately as soon as the loads showed up. However, without any filtering logic, such a solution is very impractical. Each trucker would receive thousands of notifications in a day.

A Slightly Better Solution 🤖

A slightly better solution is to apply some filtering. When the loads appear, we don’t notify the truckers immediately, because they are too far. As we notice the first truck move closer to the load, we can trigger a notification.

Here, we considered only a single variable. An optimized solution will need to address and balance all of the truckers’ motivations.

You get the idea.

Rules 👮

No constraints on language, environment, or database, if any. You can use the cloud or run this directly on any machine you like.

At a minimum, the solution should produce a list of truckers, with a list of notifications they received. It’s important for the notifications to be sent as the data come in. Waiting until the end of the run (day) to send notifications is too late.

Don’t forget to sign the waiver.

Judging ⚖️

Requirements 📐

You will need to provide the following.

Evaluation 📋

The choice of the winning team will be based on a combination of various factors.

Prizes 🏆

To participate in this challenge, each team member must read and sign a waiver. Please refer to the 123Loadboard-announcements Discord channel for instructions on how to sign and submit it. All team members must sign before the Submission Deadline, so do not wait until the last minute to request the waiver!

🥇 1st Place

🥈 2nd Place

🥉 3rd Place

What is the 30 min HR personal session?

As future interns and employees of the workforce, it is important to make sure that you’re able to show your skillset and qualities to the world during interviews and when preparing your CV. This personal session with 123Loadboard’s recruiter will answer your most burning questions, such as:

Glossary 🎓

Throughout the challenge, when communicating with us, you may hear some industry-specific terms. Here are some common ones.