GitHub repository: pampalili/ATLASGROUPTEST
Primary language: Java
Created: 2019-05-28T12:20:25Z
Description: JAVA developer assesment test ------------------------------------ Write "BACONATOR" - a Java 12 Spring Boot application conforming the following specification:      - providing REST interface (use JAX-RS style) with the "bacon" endpoint "/give-me-bacon/{howmuch}"     - upon accessing this endpoint, following happens:         - as many times as specified in {howmuch} path parameter of the "bacon" endpoint your app           retrieves JSON array of string from https://baconipsum.com/api/?type=all-meat&paras=1 using standard Java 12 HTTP client         - application takes note of retrieval start and end timestamp         - "runId" field is a random-generated ID (for example UUID) of request/response pair         - "items" is array of responses from external bacon service         - "data" field inside "items" field in output is actual data retrieved from external service         - output contains start and end timestamps for both full request and for each item as well         - example of pretty-printed application/json return data:                  {          "runId" : "abcdef",          "start": 1234646,          "end": 12354587          "items" [             {              "start": 1234646,              "end": 12354587,              "duration": "3h 19m 56s 46ms",              "data": ["Alcatra strip cow bacon..."]             }           ]         }                       - example - app is running on localhost, port 8080     - in the browser I type the following: "http://localhost:8080/give-me-bacon/5"     - I receive following response:              {          "runId" : "axgdas",          "items" [             {              "start": 1234646,              "end": 12354587              "data": ["Alcatra strip cow bacon..."]             },             {              "start":              ...             }              ...           ]         }           Don't hesitate to use coding tutorials and Stack Overflow!   Your evaluation will be based on this task, therefore it is mandatory that you work on this alone and on your own.  Estimated time to complete this task is 60-120 minutes for all levels. If it takes you significantly more time, please do not hesitate to tell us.    Acceptance criteria:  Junior must pass following: --------------------------- - your application must produce runnable spring boot war conforming assignment - if you are unsure how to produce runnable spring boot war application, just follow tutorials - deliver your solution as link to any public git repository - use git to actually push your code (do not upload it manually to repo) - use maven/gradle or any other build system - conform to Google Java style guide - https://google.github.io/styleguide/javaguide.html - if you are unsure, use auto-formatting options  Intermediate dev must pass everything above plus following: ------------------------------------- - use JDK 11 HTTP client  - use RxJava for parallel bacon JSON retrieval from external service - add statistics endpoint which provides information about     - word count (histogram)    - number of requests per IP address  Senior dev must pass everything above plus following: ------------------------------------- - implement "bacon pool", also known as "source of bacon" or "bacon cache" - choose time period of your liking (e.g. 5 seconds) and fetch single piece of bacon (i.e. single call to baconipsum) on regular basis, then: - store these pieces in queue in the application (disk persistancy is a bonus) - when user requests bacon from the endpoint either supply him with bacon (destroying stored bacon in process) or block until some bacon is available - extend statistics endpoint by average bacon waiting time per request - make sure you synchronize well - bacon is precious resource and single piece of bacon can be returned in single response only      Some bonus points: ------------------ - provide REST endpoint to retrieve historic data by their runId (cache in memory) - cache historic run data in embedded database on disk - store history in some event queue (kafka, rabbit) so application behavior can be replayed and analyzed  Ending notes: ------------- Overall quality of your code, usage of design patterns, best practices and common sense will be evaluated. You are presenting yourself with this task - please provide production-grade code.