This repository contains the instructions and the source code for the technical task that we use as part of our recruitment process at MacroActive.
This repository contains a tiny fragment of a real-life project. We have changed a range of identifiers to protect the innocent. The code is Python and targeted for version 3.10.2.
You have been asked to have a look at the code in this repository and in particular at class LegacyCalculator
. Your task is to find ways to improve the code. You can spend as much time on it as you like. As a guidance, use a time box of no more than 1 hour.
To get started, create a fork of this repository in your own Github account. We can then use the fork for the technical interview. Once you have completed the task, just send us a link to your fork. Your fork needs to be a public git repository.
There is no right or wrong answer. You won't find the solution for this task using Google. The key goal is to improve both the class LegacyCalculator
and/or the tests in class LegacyCalculatorTests
. Make sure that all test pass at all times.
In the technical interview we will discuss the improvements that you have identified and implemented. We will also discuss alternative and additional options you may have considered while working on this task.
To improve the code in this repo, you can draw from your experience with previous projects. You can also consider some of the following items:
- Are there code duplicates that can be removed?
- Have all identifiers suitable names?
- Are there enough and the right type of tests?
- How could testability be improved?
- Would it make sense to consider a mock?
You are free to add more libraries if you think they add value. However, stay focused on the task when making this choice.
To work on this task you can use any IDE that supports Python. You will need Python 3.10.2 (or similar).
On option for a free IDE is VS Code with suitable extensions for Python (most recent stable release).
This repository also has files related to a dev container. These files are located in folder .devcontainer
. You are welcome to use the dev container if you like. If you are not familiar with dev containers, you can safely ignore the content of the folder .devcontainer
. Whether you use the dev container or not has no impact on the outcome of the technical assessment.
Good luck!