This repository provides the project scaffold for a simple programming challenge. Though the challenge is very simple and a rather synthetic use-case, your results are a helpful starting point to discuss your programming flavor, skills and methodology.
BEFORE STARTING: Please take the time and read this document completely and carefully! It describes important parts of the challenge.
Implement a solution for the given tasks which aims for
-
robustness & correctness
-
readability & maintainability
-
clean software design & architecture
Be prepared to discuss your implementation and software design decisions. Show us how you would solve the task when working on your day-to-day job.
Feel free to come up with own ideas & solutions. There is no plain "right" or "wrong". Instead, we want to talk to you about how you achieved your goal and about your thoughts and design idea and process.
Between ~1.5 hour up to ~4 hours,
depending on your previous experience & development environment.
- Weather
-
In
weather.csv
you’ll find the daily weather data of a single month. Read the file, then output the day number (column oneDay
) of the day with the smallest temperature spread (difference between maximum & minimum temperature of the day.) The maximum temperature is the second columnMxT
, the minimum temperature the third columnMnT
. - Countries
-
countries.csv
contains a list of data about the 27 countries of the European Union. Use the columnsPopulation
andArea
to compute each country’s population density. Read the file, then print the name of the country with the highest number of people per square kilometre. - Task
-
-
Write a single program which is able to solve the "Weather" challenge.
-
Then refactor and extend your solution such that it additionally supports the Countries challenge.
-
- Process
-
-
Favour the software design goals described under Goal over other goals like performance or feature set.
-
Include unit tests to ensure the correctness of your implementation.
-
Your solution should focus on maintainability, reusability and readability. Here are some hints on how you may achieve these goals:
-
The most important aspect is separation of concerns. Think about the different concerns involved in the task and how they may need to change in the future. For example: one concern is reading the file. What others components can you think of? Try to design separate, concise software components for each concern.
-
Often a quick diagram illustrating the components and their interactions can be helpful. If you draw a diagram, feel free to include it in your solution.
-
Design intuitive interfaces for the components in a way that each component can be replaced. For example in the next evolution step of your solution you might need to support other data formats like JSON files or even Web services. The Reader for the CSV-files in your example could be replaced with a reader that implements the same interface but reads JSON-files.
-
Use meaningful names for classes, properties and methods. By reading the name, one should already have an idea of what something does.
-
Think about possible error cases, e.g. if a file is empty or contains invalid input, and how they should be handled. Use log messages where necessary.
-
You may use additional third-party dependencies as you see fit. Please include your reasoning for your choice of libraries in your solution.
For this project, the Java Development Kit 11 or above is required. You can download it from https://adoptium.net/.
The starting point for every challenge is provided as a branch in a GitHub hosted Git repository. Be careful to adjust the URLs below accordingly.
To start
git clone https://github.com/bettercodepaul/programming-challenge.git
or if you’ve forked the repository then
git clone git@github.com:YOURNAME/programming-challenge.git
The project scaffolds provides a Maven pom.xml
as starting
point. You should be able to start with any IDE or text editor
you are convenient with.
After installing Maven 3.x or by calling the included Maven wrapper (mvnw
and mvnw.cmd
, depending on your operating system) you should be able to
- Build & test your project
-
mvn verify
- Then to run the main class de.bcxp.challenge.App
-
mvn exec:java
- To remove the compilation output
-
mvn clean
- Or use your IDE functionality
-
to run & debug your program.