Skip to content

treksn/programming-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BettercallPaul programming challenge

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.

Goal

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.

Tasks

Time estimation

Between ~1.5 hour up to ~4 hours,
depending on your previous experience & development environment.

Task

Weather

In weather.csv you’ll find the daily weather data of a single month. Read the file, then output the day number (column one Day) of the day with the smallest temperature spread (difference between maximum & minimum temperature of the day.) The maximum temperature is the second column MxT, the minimum temperature the third column MnT.

Countries

countries.csv contains a list of data about the 27 countries of the European Union. Use the columns Population and Area 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
  1. Write a single program which is able to solve the "Weather" challenge.

  2. 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.

Hints

Your solution should focus on maintainability, reusability and readability. Here are some hints on how you may achieve these goals:

  1. 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.

  2. 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.

  3. 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.

  4. Use meaningful names for classes, properties and methods. By reading the name, one should already have an idea of what something does.

  5. 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.

  6. You may use additional third-party dependencies as you see fit. Please include your reasoning for your choice of libraries in your solution.

Getting started

Install Java

For this project, the Java Development Kit 11 or above is required. You can download it from https://adoptium.net/.

Getting a copy

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

Fork or directly clone the repository

git clone https://github.com/bettercodepaul/programming-challenge.git

or if you’ve forked the repository then

git clone [email protected]:YOURNAME/programming-challenge.git

Building and running

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.

Submitting your results

Ideally you provide your solutions as Git repository with appropriate commits and descriptions. If you have a GitLab.com or GitHub account, please feel free to publish your solution there.

About

A simple programming challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%