This is a skills assessment test one company I interviewed with sent me. This is my solution to the assessment. This was my first ever REST API written in Java Spring. I had 6 hours to work on this. I am pretty familiar with Java, so it was not such a steep learning curve for the API constructs.
Basically I was supposed to create a Java REST Api that had two endpoints.
The end points were as follows
@post:/event
insert an event@get:/event
find the mean amount of events placed in the last 60 seconds
To run the code:
mvn spring-boot:run