- All data for this test is provided in the survey-data directory.
- We have provided a simple application that loads the JSON data from survey data into classes, you may use this as a starting point, or start your implementation from scratch.
- For the purposes of this task please consider the following rules as factual:
- Each question is a single choice and responses can not contain more than one response for each question per respondent
- Each answer choice contains a
route
, when a respondent selects this answer, thisroute
is the next question the respondent will be served - Where an answer choice does not contain a
route
this should be considered the end of the survey - Respondents can only answer each survey once, and respondent IDs are universally unique
- Each question contains a
payout
this is the amount (in pence) that a respondent will be paid for answering the question - The integer value
choice
in each response refers to the index of the option in the question it is referring too
- Find the number of questions that each respondent has answered so far as part of
survey 1
(id:200
) - Find the amount of money (in pence) earned by each respondent for the answers they have given so far as part of
survey 1
(id:200
)
We don't expect you to spend more than around an hour on this take home task.
We care about the following (in priority order):
- Correctness: does your solution correctly implement the functionality required and return the correct results?
- Simple, clean, and readable code: is the code easy for us to follow and understand?
- Performance: is your solution sufficiently performant given the task it is performing?
Should you be invited for a follow-up pairing session we will:
- Discuss your approach to the task listed above
- Ask you to implement more functionality around routes through a survey (note surveys are not necessarily strictly linear, and answers can route to questions other than the next index) More information regarding survey routes can be found here
There is no need to manually install gradle in order to use it in this repo, simply use the included gradlew
(MacOS, Linux) or gradlew.bat
(Windows)
To build, test and run the project use the following tasks
$ ./gradlew clean build run
First install Maven if you don't already have it installed. This can be done in a number of ways
- The official way and for Windows users
- On MacOs with Homebrew
$ brew install maven
- On Linux with APT package manager
$ apt install maven
To build, test and run the project use the following tasks
$ mvn clean package exec:java