Systems Design Test

Aim: To design and build a real-time restaurant inventory manager. 

Problem Description:
You have a franchise of some restaurants. At the beginning of each day, you need to stock up the inventory of each restaurant with ingredients required to serve the items listed in its menu. You decide to build a system which calculates what items need to be bought and in which amount in the beginning of the day. You need to order enough amount of each item to serve its menu for the entire day. Once you have stocked up, customers start placing their orders and your restaurant starts serving them their item of choice till that restaurant does not run out of ingredients. The next day you have information regarding the state of the inventory and the orders of the previous day. Using this, you need to decide how to restock the inventory the next day. If any ingredient has expired, you are not supposed to use them to place orders.

  1. The menu for each restaurant
  2. List of ingredients required for each item in the menu
  3. List of ingredients and the number of days in which they expire 
  4. List of orders being placed each day at each restaurant

Two files with the given information.
  1. The orders you place for the inventory with each line in the following 
    Date, Restaurant_ID, Ingredient to be bought, Quantity to be bought
  2. The state of inventory at the beginning of every day(before you place orders for that day) with each line in the following:
    Date, Restaurant ID, Ingredient, Quantity present in inventory before ordering
More details can be found in the helper doc.

Submission Requirements :
You are expected to submit the following:
  1. UML of the system or a diagram showing the control flow and/or module dependencies
  2. Code for the proposed system hosted on BitBucket or GitHub
  3. Instructions on how to build the system and run it on the test data

Scoring :
The scoring will be based on the following factors:
  • Fidelity: The system should handle orders and restock the inventories correctly. 
  • Design: How do you create modules, data models and how they interact with each other? Do you follow OOP principles?
  • Scalability: The system should scale well to any number of restaurants and orders.
  • Performance: The system should perform well for about 100,000 orders. 
  • Extensibility: How easy is it to add new features or replace components?
  • Brownie points for new features and/or unit/integration tests

Q: Is there any restriction on the programming language being used?
A: We would prefer if the code is in C++, Java or Python. We are looking for an object oriented design with emphasis on data locality.

Q: What happens when an order is placed for which ingredients are not available?
A: You are not supposed to fill the order. The inventory will not change due to the processing of the order. Restocking can only happen in the beginning of the next day.

Please feel free to get in touch with us if you have any queries. 
You can send an email to data-science-challenge (AT) tworoads (dot) co (dot) in to reach us.

Subpages (1): Helper Doc