Code Monkey home page Code Monkey logo

ifood-backend-menu-test's Introduction

iFood Backend Test - Menu

Create a micro-service able to accept HTTP requests receiving a restaurant id as a parameter and returning its menu(s).

Based on the requirements below, elaborate your own data model and create a database to store the data (you may populate the database manually).

Fork this repository and submit your code.

Requirements

  • Restaurant is a entity that contains one or more Menus.
  • Chain is an entity that contains Restaurants.
  • Chain can contain Menus or not.
  • Restaurant can be associated to a Chain or not.
  • Restaurant associated to a Chain inherits its Menu, but can override any item.
  • You don't need to model the entire Restaurant/Chain entity. Only the ids and their relation are enough.
  • Menu is basically composed by 4 entities: Item, Item Group, Option and Option Group (its relations and properties are up to you to decide).

Non functional requirements

As this service will be a worldwide success, it must be prepared to be fault tolerant, responsive and resilient.

Also, it can host thousands of restaurants' Menus, so it must be modeled to be easily manipulated (create/update/delete operations that doesn't need to be implemented, but must be considered in the modeling). For example: if the restaurant runs out of "bacon" and need to set all Items/Options that contains "bacon" as unavailable, we should easily implement that operation.

This solution may be used in the integration with other systems/services.

You may consider how your micro-service will expose "Template Items" like Pizza (an Item that contains sizes/base/crust/toppings/extras) and Combos (an Item that contains a combinations of other Items at different prices). They can be modeled as regular Item/Item Group/Option/Option Group, but they may be exposed differently.

Use whatever language, tools, frameworks and databases you feel comfortable to.

Also, briefly elaborate on your solution, architecture details, choice of patterns and frameworks.

Hints

You can check iFood's restaurants and its menus at https://www.ifood.com.br/delivery/campinas-sp/ (but remember: this may not be the best solution).

There's also public Menu API's on the web you can check for inspiration. If you use any, please remember to mention.

Examples

The "Pizza" entity should be offered in three different sizes (small, medium and large).

There may be as many toppings as the restaurant need (at least, for this example, "Muzzarela", "Calabrezza" and "Margherita").

A pizza may be ordered with one, two or three different toppings options. Each topping should be customizable (for instance, "additional onions" or "additional bacon").

Also, as an option a customer may choose "Cheddar Stuffed Crust" instead of our traditional crust.

It's important to notice that the total price for the pizza may vary according to the customers' choices. For instance, "Cheddar Stuffed Crust" on a small pizza is cheaper than the option on a large pizza.

When the restaurant runs out of "cheddar", pizzas cannot be ordered within this option.

Also, as example, it follows four Items sold by a fictional restaurant:

  1. Chips (~$4)

    • Optionals (Pick any):
      • Bacon (+$1)
  2. Double Cheese Burger (~$12)

    • Optionals (Pick any):
      • Salad (+0)
      • Extra burger (+$3)
      • Bacon (+$2)
  3. Cola ($3)

  4. Combo nÂş5 (~$17)

    • Double Cheese Burger
      • Pick at least two among:
        • Onions (+0)
        • Salad (+0)
        • Extra burger (+$3)
        • Bacon (+$2)
      • Side dish (pick one):
        • Onion rings (+$1)
        • Chips (+0)
          • Optionals (Pick any):
            • Bacon (+$1)
      • Beverage (pick one):
        • Soda:
          • Cola
          • Dr Pepper
        • Juice (+$1):
          • Orange
          • Lemon

If the restaurant runs out of Bacon, items 1, 2 and 4 from the given example should display the Bacon garnish option as "SOLD OUT".

ifood-backend-menu-test's People

Contributors

gplatzeck avatar pedrooshika-nomad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.