This exam is made up of three parts. These test your ability to explain and apply development principles.
You can get a total of 16 points. These points are distributed as follows:
Component | Number of points | Time suggestion |
---|---|---|
Part 1 | 4 | 15 min |
Part 2 | 8 | 30 min |
Part 3 | 18 | 90 min |
The following websites are available during the test:
Answer the questions below.
Write your answers in the studentAnswers.md
. There is a .md file for english and dutch. Choose the language you prefer. (You must not add other languages!)
What is meant by a declaration? How would you define what this is? Give two examples.
Write your answer in the student answers file of the project.
What is meant by “KISS”? Give an example of this too.
Write your answer in the student answers file of the project.
The resources folder contains a file which lists pokemon and their characteristics. Some fields are:
This last field is a boolean.
For instance, the first pokemon in the list is “Bulbasaur”, which has the types “Grass” and “Poison”. It has 45 hitpoints. It belongs to generation 1. And it is NOT a legendary. Please note that a bit further down: “Squirtle” only has a type “Water” the other type is empty.
There are four methods with no meaningful content (doStreams1(), doStreams2(), etc.) They are used to display information about the dataset.
Implement the four methods using java streams. Any other implementation method will not award any points.
In this segment you will improve a rather badly written program. The questions below will guide you through the process.
You are ONLY required to change the code of the TourismManager
. The Application
and the PointOfInterest
class do not require any changes.
This program loads a list of Point of Interests (PointOfInterest
) or POI’s. The tricky thing is that my datasource contains different “fields” per item. Some have a field “artist”, others have a “webpage” or other codes that we don’t need to understand.
There are only four fields guaranteed:
The lat and long identify the POI’s location. The tourism fields can have the following values: “statue”, “museum”, “viewpoint”, “hotel”. But there may be many other possible values!
Reading POI’s from a file delivers data in a non-generic list structure.
DoublyLinkedList
is actually empty.The POIManager uses a lot of fixed value to analyse the JSON structure. Improve the code to use either constants of enums. Also simplify the code by applying KISS.
Once again, the implementation of the TourismReader
class must not be changed except for the following.
The POIManager
is now directly dependent on the TourismReader
, this makes testing
the POIManager
hard. We want you to use dependency injection so that we can test its
functionality separately without having to read an actual file.
Please write tests for the following classes and situations:
PointOfInterest
class stores data correctly.PointOfInterest
class throws the correct exceptions.After making changes to the code, please confirm that the code clearly improves.
Create packages that divide the code in clear segments.
When writing tests follow these rules: