Coder Social home page Coder Social logo

ifood-backend-connection-test's Introduction

iFood Backend Test - Connection

Our goal is to be the best delivery company in the world. In order to achieve that we must do our best to manage the connection between iFood platform and all of our 100.000 restaurants.

Tasks

Your task is to develop one (or more, feel free) service(s) to:

  • handle connection between Restaurant and iFood Platform
  • store and delete schedules of unavailabilities
  • consolidate and provide data about the restaurants' connection

You also will have to emulate a client (keep it simple) for the Restaurant. The client must:

  • guarantee “keep-alive” interactions with your service
  • create and cancel schedules of unavailabilities

Fork this repository and submit your code.

Business Rules

  • In iFood Platform, the opening hour for the Restaurants are from 10:00 am to 11:00 pm.
  • A Restaurant may be available/unavailable.
  • A Restaurant may scheduled the status unavailable, due to the following reasons:
    • lack of delivery staff
    • connection issues (bad internet)1
    • overloaded due to offline orders
    • holidays
  • A Restaurant may also be online/offline:
    • In order to a Restaurant be considered online, it must be inside the opening hour AND have interacted with our platform (aka sent a keep-alive signal) in the last two minutes AND its status should be available. Otherwise, it should be considered offline.
  • The Restaurants are ranked according to the time they spent offline, inside the opening hour, without a scheduled unavailability.
  • Example: restaurant connection timeline

Requirements

In order to handle 100.000 simultaneously connections, we would like to use an IOT protocol (like MQTT or XMPP) for this scenario.

You will have to keep the connection state of the Restaurants freshly available for whoever wants to query it. We advise the use of some type of compute grid to do this processing in parallel by the instances of the service. Apache Ignite might be a good choice. Or not.

This service needs to answer promptly:

  • Given a list of Restaurants, whether they are online or offline.
  • Given a specific Restaurant, its unavailability history.
  • Reports for iFood commercial team so they can measure how our Restaurants are ranked, according to the amount of time they spent offline (see the diagram above, the red section on the "Restaurant Status" timeline).

ifood-backend-connection-test's People

Contributors

poshika avatar

Stargazers

 avatar

Watchers

 avatar  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.