Cloud Software Engineer Code Challenge - aacml/Recruiting GitHub Wiki
We have created a small technical test for you to showcase how you work.
Your task will be to create a dockerized microservice that queries, filters and transforms a given API.
Challenge
- Implement the following use case considering the requirements.
Use Case
-
The API Endpoint to be processed by your microservice is
https://codechallenge.mobilelab.io/v1/mytoys/navigation
and requires the API-KeyN8Nx0OwOvo1iuN2ZkFHZlyVKBVgoIcy4tUHMppO5
asx-api-key
request header field.- You can preview the response in the terminal if you use curl with the
header option to set the x-api-key
curl -H 'x-api-key:N8Nx0OwOvo1iuN2ZkFHZlyVKBVgoIcy4tUHMppO5' https://codechallenge.mobilelab.io/v1/mytoys/navigation
- The JSON structure of the response:
{ "navigationEntries": [{ "type": "section", "label": "Sortiment", "children": [{ "type": "node", "label": "Alter", "children": [{ "type": "node", "label": "Baby & Kleinkind", "children": [{ "type": "link", "label": "0-6 Monate", "url": "http:\/\/www.mytoys.de\/0-6-months\/" }, { "type": "link", "label": "7-12 Monate", "url": "http:\/\/www.mytoys.de\/7-12-months\/" }, { "type": "link", "label": "13-24 Monate", "url": "http:\/\/www.mytoys.de\/13-24-months\/" }] }, { "type": "node", "label": "Kindergarten", "children": [{ "type": "link", "label": "2-3 Jahre", "url": "http:\/\/www.mytoys.de\/24-47-months\/" }, { "type": "link", "label": "4-5 Jahre", "url": "http:\/\/www.mytoys.de\/48-71-months\/" }] }] }] }] }
- You can preview the response in the terminal if you use curl with the
header option to set the x-api-key
-
Your microservice has to provide the following http endpoint:
- /links
-
That provides a JSON of the following structure:
[ { "label": "Sortiment - Alter - Baby & Kleinkind - 0-6 Monate", "url": "http:\/\/www.mytoys.de\/0-6-months\/" }, { "label": "Sortiment - Alter - Baby & Kleinkind - 7-12 Monate", "url": "http:\/\/www.mytoys.de\/7-12-months\/" }, { "label": "Sortiment - Alter - Baby & Kleinkind - 13-24 Monate", "url": "http:\/\/www.mytoys.de\/13-24-months\/" }, { "label": "Sortiment - Alter - Kindergarten - 2-3 Jahre", "url": "http:\/\/www.mytoys.de\/24-47-months\/" }, { "label": "Sortiment - Alter - Kindergarten - 4-5 Jahre", "url": "http:\/\/www.mytoys.de\/48-71-months\/" } ]
-
That can be invoked via
curl http://localhost/links
You can use any port or basepath, but document it's configuration or usage.
-
Accepts the optional GET-Parameter
parent
.Examples:
- Request:
curl http://localhost/links?parent=Alter
- Response:
[ { "label": "Baby & Kleinkind - 0-6 Monate", "url": "http:\/\/www.mytoys.de\/0-6-months\/" }, { "label": "Baby & Kleinkind - 7-12 Monate", "url": "http:\/\/www.mytoys.de\/7-12-months\/" }, { "label": "Baby & Kleinkind - 13-24 Monate", "url": "http:\/\/www.mytoys.de\/13-24-months\/" }, { "label": "Kindergarten - 2-3 Jahre", "url": "http:\/\/www.mytoys.de\/24-47-months\/" }, { "label": "Kindergarten - 4-5 Jahre", "url": "http:\/\/www.mytoys.de\/48-71-months\/" } ]
- Request:
curl http://localhost/links?parent=Baby%20%26%20Kleinkind
- Response:
[ { "label": "0-6 Monate", "url": "http:\/\/www.mytoys.de\/0-6-months\/" }, { "label": "7-12 Monate", "url": "http:\/\/www.mytoys.de\/7-12-months\/" }, { "label": "13-24 Monate", "url": "http:\/\/www.mytoys.de\/13-24-months\/" } ]
- Request:
-
Accepts the optional GET-Parameter
sort
.- Implement it as specified here.
- In our case the keys are
label
andurl
. - Examples:
curl http://localhost/links?sort=url
curl http://localhost/links?sort=label:asc,url
curl http://localhost/links?sort=url:desc
-
- /links
Requirements
- Implement the microservices functionality using Java or Kotlin.
- Provide a Dockerfile which encapsulates this microservice.
- Assume that our testing environment meets the following dependencies:
- It is a UNIX system. In our case it will be a linux virtual machine.
- It provides docker.
- It provides bash.
- There is no Java runtime or SDK installed. Make sure to build and run your project inside docker containers.
- Think about HTTP-response-headers and -codes (e.g. there is no item whose label matches
parent
). - Consider test coverage: unit test and/or integration test
- Write a paragraph or two on how you approached the work and what you considered during development.
- Provide a README.md in which you describe how to make it run.
- If you have time to kill specify your microservice's endpoint and datastructure(s) using OpenApi/Swagger.
- This is not necessarily required, but if you are experienced with this technique, don't hide it.
- We like git. So feel free to send us the link to your git repository on github, bitbucket, etc or send us the project as zipped archive.
Hints
- Feel free to use open-source-frameworks and -libraries.
- If you have any questions, email us and we can add it to this task.
Good Luck!