This exercise is designed to test your ability to write code that is easy to understand, maintain, and test, as well as the ability to use the tools/methods that are commonly used in our community. The exercise is designed to be completed in 2-3 hours. If you are not able to complete it in this time, please do not worry. We are more interested in the quality of your code than the speed at which you write it.
You will be asked to follow the instructions in this README.md file and also detailed instructions in every file.
This project is supposed to help the Maestro Pizza Maker to be more efficient in his work. The project is divided into two parts: the maestro_pizza_maker package and the notebooks directory.
Some parts of the project are already implemented and some are not. Your task is to implement the missing parts. Please read the instructions carefully and everytime you see TODO in the code, implement the missing part.
There are two main classes in the maestro_pizza_maker package: Pizza and PizzaMenu. the Pizza class represents a single pizza and the PizzaMenu class represents a menu of pizzas. The PizzaMenu class is implemented in the maestro_pizza_maker/pizza_menu.py file and the Pizza class is implemented in the maestro_pizza_maker/pizza.py file.
Pizza consists of predefined ingredients, which are represented by the PizzaIngredient class. The PizzaIngredients class is implemented in the maestro_pizza_maker/ingredients.py file. The PizzaIngredients class is already implemented and you do not need to change it. Here just please carefully go through the code and get familiar with it. Special atttention should be paid to the types of PizzaIngredient class attributes.
There is also sand_box directory, which contains some code that is not meant to be interactited with. It just provides drawings from Multivariate Normal Distribution used in the PizzaIngredients class.
Please go through the code and try to understand, how the code works. If it is not clear to you after first reading, please don't worry, the exercise is designed to guide you through the code step by step.
- Fork this repository to your own GitHub account.
- Clone the forked repository to your local machine.
- Install the requirements from the
requirements.txtfile via pip or conda or frompyproject.tomlvia poetry. - Follow the instructions here in the
README.mdfile and also detailed instructions in each file. - Solving the exercise in the order listed below is recommended.
- Commit and push your changes to your forked repository at least one day before the interview.
- Send us the link to your forked repository.
- Implement
average_fatproperty in thePizzaclass (filemaestro_pizza_maker/pizza.pyline 78). 1.1. Read TODO properly. 1.2. Optional: Consider writing a test for this property to make sure it works properly and all the objects are created properly. It will help you to understand the code better. - Implement
nameproperty in thePizzaclass (filemaestro_pizza_maker/pizza.pyline 92). 2.1. Read TODO properly. 2.2. Optional: Consider writing a test for this property. - Implement
tasteproperty in thePizzaclass (filemaestro_pizza_maker/pizza.pyline 99). 3.1. Read TODO properly. 3.2. Optional: Consider writing a test for this property. - Implement
to_dataframemethod in thePizzaMenuclass (filepizza_maker/pizza_menu.pyline 15). 4.1. Read TODO properly. 4.2. Optional: Consider writing a test for this method. - Implement properites
cheapest_pizzaandmost_caloric_pizzain thePizzaMenuclass (filemaestro_pizza_maker/pizza_menu.pyline 39, 44). 5.1. Optional: Consider writing a test for these properties. 5.2. Optional: Consider writing other properties that might be useful. - Implement method
get_most_fat_pizzain thePizzaMenuclass (filemaestro_pizza_maker/pizza_menu.pyline 48). 6.1. Read TODO properly. 6.2. Optional: Consider writing a test for this method. - Implement
add_pizzamethod in thePizzaMenuclass (filemaestro_pizza_maker/pizza_menu.pyline 53). 7.1. Optional: Consider writing a test for this method. - Implement
remove_pizzamethod in thePizzaMenuclass (filemaestro_pizza_maker/pizza_menu.pyline 57). 8.1. Read TODO properly. 8.2. Optional: Consider writing a test for this method. - Implement
__len__method in thePizzaMenuclass (filemaestro_pizza_maker/pizza_menu.pyline 63). 9.1. Optional: Consider writing a unit test for this method usingpytest. - Implement methods
menu_sensitivity_protein,menu_sensitivity_carbs,menu_sensitivity_fatin the filemaestro_pizza_maker/pizza_sensitivities.py. 10.1. Read TODO properly. - Implement methods
taste_at_risk_pizza,taste_at_risk_menu,conditonal_taste_at_risk_pizzaandconditonal_taste_at_risk_menuin the filemaestro_pizza_maker/taste_at_risk.py. 11.1. Read TODO properly. - Design and implement optimization model
maximize_taste_penalty_pricein the filemaestro_pizza_maker/pizza_optimizer.py(line 193). 12.1. Read TODO properly. 12.2 Find inspiration in theminimize_pricemodel (filemaestro_pizza_maker/pizza_optimizer.py, line 46) - Go to the notebook
notebooks/menu_analysis.ipynband follow the instructions there. 13.1. Follow the instructions in the notebook cell by cell. 13.2 Creativity is welcome.
Good luck!