/Dunzo

Primary LanguageJava

Clean working code with Multithreading and Unit Tests for Dunzo interview assignment

Write the working code to create a working coffee machine. Here are the desired features

  1. It will be serving some beverages.
  2. Each beverage will be made using some ingredients.
  3. Assume time to prepare a beverage is the same for all cases.
  4. The quantity of ingredients used for each beverage can vary. Also, the same ingredient (ex: water) can be used for multiple beverages.
  5. There would be N ( N is an integer ) outlet from which beverages can be served. For N = 2 [ 2 outlets in a machine ]

For N = 3 [ 3 outlets in a machine ]

  1. Maximum N beverages can be served in parallel.
  2. Any beverage can be served only if all the ingredients are available in terms of quantity.
  3. There would be an indicator that would show which all ingredients are running low. We need some methods to refill them. 10.Please provide functional integration test cases for maximum coverage.

Buy me a coffee if you get in Dunzo using this.