dimanche 28 janvier 2018

suitable design pattern for an application

This is a question I encountered in a C++ test interview :

You are writing an application aiming at making cocktails. A cocktail contains several ingredients (according to the customer's order) and it can quickly become complex to prepare.

However, the different steps in the preparation process remain the same: adding an alcohol, adding a syrup, etc...

If you know a design pattern that would be appropriate to prepare these cocktails. type its name in the text field.

I think I gave an incorrect response (Decorator). I think the "Builder" pattern is the correct response.

Aucun commentaire:

Enregistrer un commentaire