Harry-Kart in a special kind of horse racing.
The horses participating have a base speed, they can run with that speed indefinitely.
The track is a 1000 meters loop and is divided in lanes, each horse runs on a lane and every lane has the same length.
The horses run the first loop at their base speed but at the end of each loop they find a power-up or power-down.
The power-ups/downs are numbers, negative or positive, representing how much the horse speeds up or slows down.
This project is to compute the top 3 rankings.
Number of loops: 3
Start List:
Lane | Horse name | Base speed |
---|---|---|
1 | TIMETOBELUCKY | 10 |
2 | CARGO DOOR | 10 |
3 | HERCULES BOKO | 10 |
4 | WAIKIKI SILVIO | 10 |
Power-Ups/Downs:
Loop | Lane 1 | Lane 2 | Lane 3 | Lane 4 |
---|---|---|---|---|
1 | 1 | 1 | 0 | -2 |
2 | 1 | -1 | 2 | -2 |
{
"statusCode": 200,
"responseMessage": [
{
"position": 1,
"horseName": "TIMETOBELUCKY"
},
{
"position": 2,
"horseName": "HERCULES BOKO"
},
{
"position": 3,
"horseName": "CARGO DOOR"
}
]
}
The API gateway will recieve requests from the any client facing Application and direct them to their respective API endpoint where it will processed.
-
Code Quality : Ensured that the code is readable and obeys the SOLID, KISS principals.
-
Well tested : Using integration tests, ensured that the solution achieves it's main objective and verified how it handles bad input.
-
Maintainable : I have kept the functions as generic as possible to be able to be reused, as much as possible. eg: read generic inputs and write generic output.
-
API Gateway: In order provide security to the API considering overuse and abuse and for more control over monitoring the usage.This also comes with a developer portal experience so that the developer can test the APIs on the browser prior integration.
-
CI/CD pipeline: Using Github actions all the changes I pushed to repository will be build and it's binaries willl deployed to the API directly cutting any manual work of publishing APIs and identifying problems early.
-
Logging/Monitoring: I have enabled the use log streaming and application insights to monitor all incoming requests, thereby easier for investigating any failures or anomalies.
-
API documentation: For a seemless integration experience, API documentation is valuable. I have enabled Swagger API documentation for the endpoint.
https://harry-kart-apim.developer.azure-api.net
Note: Click on Explore API button to see the list of the APIs
-
Please copy and replace the application.properties file provide via email at src/resources/
-
Open the solution on IntelliJ
-
Build the project
-
Run solution.
-
See developer portal to see the API documentation to try out locally on a rest client.