Skip to content

A collection of different programming challenges. Please be aware of the different branches.

License

Notifications You must be signed in to change notification settings

Tabea4/programming-challenge

 
 

Repository files navigation

UML class diagram - Solution Tabea

  • Private methods and variables have been omitted for better readability

UMLClassDiagram

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

Football

The football.csv file contains results of the English Premier League. The columns labeled ‘Goals’ and ‘Goals Allowed’ contain the total number of goals scored by and against each team (so Arsenal scored 79 goals themselves and had 36 goals scored against them). Read the file, then print the name of the team with the smallest distance (absolute difference) between ‘Goals’ and ‘Goals Allowed’.

Task
  1. Try to write a single program, which is able to solve the "Weather" challenge.

  2. Then try to refactor & extend your solution, that it additionally supports the Football challenge.

Process
  • Favour the software design goals described under Goal over other goals like performance or feature set.

  • Try to follow a test-driven development approach.

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. Document your development by small, frequent git commits that address a specific matter each (e.g a feature). Try to make the commit messages as expressive as possible, so a reader knows what a commit does.

Getting started

Install Java

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

Getting a copy

The starting point for every challenge is provided as a branch in a Gitlab.com/GitHub hosted Git repository. Be careful to adjust the URLs below accordingly.

To start

Fork or directly clone the repository

git clone https://[gitlab|github].com/exxcellent/programming-challenge.git

or if you’ve forked the repository then

git clone git@[gitlab|github].com:YOURNAME/programming-challenge.git

See what challenges are available by listing the branches present:

git branch -a

Switch to the branch of the challenge assigned

cd programming-challenge
git checkout challenge-CHALLENGENAME

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 you should be able to

Build & test your project

mvn verify

Then to run the main class de.exxcellent.challenge.App

mvn exec:java

To remove the compilation output

mvn clean

Or use your IDE functionality

to run & debug you 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 collection of different programming challenges. Please be aware of the different branches.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published