No description
Find a file
2026-08-24 17:07:54 +02:00
.claude Initial commit 2026-08-24 16:44:25 +02:00
.idea Initial commit 2026-08-24 16:44:25 +02:00
src/main/java/umans/ricardo Initial commit 2026-08-24 16:44:25 +02:00
.gitignore Adding a README.md file with instructions & updating .gitignore 2026-08-24 17:07:54 +02:00
pom.xml Initial commit 2026-08-24 16:44:25 +02:00
README.md Adding a README.md file with instructions & updating .gitignore 2026-08-24 17:07:54 +02:00

Karting Timing Assessment

Thanks for taking the time to review this timing assessment. I am looking forward to our meeting.

The intended purpose of this API is to provide a UI with capabilities of showing and maintaining a session leaderboard, and connecting an external system connected to the track sensors.

Requirements

  • JDK 25
  • Maven
  • Optionally: Postman

Instructions

To run this application:

  • Navigate to the main folder
  • mvn spring-boot:run

To use this application:

The timing system has been built with Race and Time Attack sessions in mind. The System is only a backend RestFUL API.

Start a Session

To register laptimes, a user must first create a session by calling the POST localhost:8080/start endpoint with the following mandatory body.

{
    "sessionType": "TIME", // TIME or RACE
    "sessionStartTime": "2026-01-01T12:00:00.000"
}

Handling sensor inputs

During an active session, the system is able to process lap completed events by POST localhost:8080/lap.

{
    "kartNumber": 1,
    "eventTime": "2026-01-01T12:01:10.000"
}

The API will respond using a SessionResult object to update the current leaderboard.

Ending a session

To end a sesson, a user can do POST localhost:8080/end with an empty body.

The result will be shared from a SessionResult object which looks like:

{
    "results": [
        {
            "position": 1,
            "kartNumber": 5,
            "totalTime": 273.0,
            "fastestLap": 56.0,
            "totalLaps": 4,
            "fastestLapNumber": 4,
            "fastestLapStartTime": "2026-01-01T12:03:37"
        },
        {
            "position": 2,
            "kartNumber": 2,
            "totalTime": 260.0,
            "fastestLap": 59.0,
            "totalLaps": 4,
            "fastestLapNumber": 1,
            "fastestLapStartTime": "2026-01-01T12:00:01"
        },
        { ... }
    ]
}

To run the .csv file

Using Postman:

  • Create the required /start, /lap & /end endpoints
  • Manually trigger the start using this body:
{
    "sessionType": "TIME",
    "sessionStartTime": "2026-01-01T12:00:00.000"
}
  • Using the automated runner in postman to trigger /lap endpoint with variables from the csv file
{
    "kartNumber": {{kart}},
    "eventTime": "2026-01-01T{{passingtime}}"
} 
  • Trigger the /end endpoint to end the session and read the session results.

Known limitations

Out-of-order event handling is not supported and is likely to cause bugs.

Solving this would be done by re-calculating the entire list of Laps a user has done, simply by storing all laptime timestamps, sorting and then looping through them.