Behind the scenes: how an iFood order works

Discover the route of an order from our (digital) front door to your front door.

The journey of an order from our (digital) front door to your front door.

You got hungry, so you decided to open the iFood app to order something. Just by opening the application, we already had to put our engineering time to work.

First we check the basic things: your username/login, your last used address (which is at the top) and your current GPS position — because if address and GPS are different, we will suggest that you take a look at the address.

Then, we also check all the lists and categories that are active on iFood at that moment, such as markets, lists of restaurants with free delivery, promotional lists, scheduling lists, lists of Super-Restaurants (the best on iFood), among others.

Several of these lists are only active for certain cities, times of day or group of customers. Yes, you may occasionally be involved in an A/B test, whether on promotional lists or on a specific functionality that we are testing.

These help a lot to move quickly and understand if what is being tested actually has the value we were imagining . Furthermore, it would also help to understand whether we should scale a tested solution to the rest of the customer base.

The journey of an order from our (digital) front door to your front door.

You got hungry, so you decided to open the iFood app to order something. Just by opening the application, we already had to put our engineering time to work.

First we check the basic things: your username/login, your last used address (which is at the top) and your current GPS position — because if address and GPS are different, we will suggest that you take a look at the address.

Then, we also check all the lists and categories that are active on iFood at that moment, such as markets, lists of restaurants with free delivery, promotional lists, scheduling lists, lists of Super-Restaurants (the best on iFood), among others.

Several of these lists are only active for certain cities, times of day or group of customers. Yes, you may occasionally be involved in an A/B test, whether on promotional lists or on a specific functionality that we are testing.

These help a lot to move quickly and understand if what is being tested actually has the value we were imagining . Furthermore, it would also help to understand whether we should scale a tested solution to the rest of the customer base.

Algorithm in action

Moving forward, an algorithm for machine learning is responsible for understanding the behaviors and patterns of eating habits of groups of people who order on iFood and, from there, suggesting the restaurants that make the most sense for you, placing them in your home.

The model takes into account a series of variables and translations relating customers' eating habits and restaurant offerings that are most suitable with this moment of opening the app.

With some degree of certainty, we could say who is very likely to order pizza the next time the app is opened at a certain time, given the amount of data we have. Angry, right?

To create a list of local restaurants, we also check basic things about the restaurants, such as opening hours and whether the restaurant is online on the platform. After all, it makes no sense to suggest a restaurant that is closed!

This list also shows the distance between you and the restaurant, the expected delivery time and delivery fees. Later on I will explore this a little more.

I chose my restaurant. What happens now?

When you choose a restaurant, you enter the menu experience. In it, we show you all the dishes and categories active in that restaurant, for that given day and opening time.

The restaurant is able to offer different menus per day and time, and this is at its best.

On the menu you can put together your entire order by selecting the dishes/items, complements and, possibly, putting a note to the restaurant about a specific item (like asking to take aliche off the aliche pizza 😅).

Everything is fine with your choice and you now go to check-out — which at iFood we call a bag.

The application bag for the end consumer

The bag experience, like that of any shopping cart closing in e-commerce, is super critical. The time that takes care of this around here doesn't play around on the job. Everything has been thought out to guarantee all the necessary information so as not to impede your order completion.

Complex things also happen in this step. We check and display the available payment methods, the coupons made available to you (if we sent you the notification we need to have the coupon there), if you have an available balance in your iFood Wallet and your option to pay with it, and for Here it goes.

I don't intend to go into too much detail about payment issues as it would be a post just for that, but the important thing is: I closed my order. Are you already arriving?

the daddyhe from our partner, the restaurant

When your order is placed, we pass all the information to the restaurant. Including your observation to remove the aliche from the pizza.

At this point, the restaurant may or may not accept your order. We do this because, sometimes, the restaurant can be super busy, already producing more dishes than it can handle and without the possibility of serving one more.

Many of the restaurants also have a physical space/hall and the demand from iFood is only part of the total demand it is accepting.

In general, the restaurant has around 8 minutes to confirm whether you can produce your order. If he doesn't do this, we automatically cancel so that you, the customer, don't have the false expectation that things are going well.

The order confirmation screen in the Order Manager (mobile)

When the restaurant confirms your order, we notify you that everything is ok through a push notification which says that “the order is already being prepared”.

From now on, you will consider that This hypothetical restaurant is an iFood Delivery type, in which we operate all the delivery logistics for its orders, so it can focus exclusively on producing your dish with all the care.

It's important to say that this part below is the one I like the most, as it's where the squads in which I work as a Product Manager work!

Where does iFood logistics work begin?

Before you open the app! In truth.

Before you even open iFood, the our opening hours live monitoring is already following each of the cities in which we have iFood Delivery . We check whether we have a sufficient number of delivery people for the number of orders, whether a certain region has any kind of imbalance, and we monitor late orders — when your order is late, we open an automatic case internally and even start prioritizing your order. delivery.

Before you open the app, another model of machine learning works to build delivery time forecasts for a given restaurant, in a given delivery radius and on a given day and time of the week . The model also predicts the “cooking time” of orders, crucial information for making decisions about when we will send the delivery person to the restaurant.

Except when we have a more forceful strategy, focused on marketing and coupons (consequently with greater demand than normal), it is quite possible to predict the delivery time of Entrega iFood restaurants with good accuracy, so that the promised times are fulfilled. But “quite possible” does not mean that the work is trivial.

The logistics are quite complex, as orders are “born” all the time, spread across the city, and delivery people are also on the move all the time, sometimes with an order loaded and heading for delivery, sometimes waiting for us to place a new order. for him.

This model understands the behavior pattern of these times, taking into account other set of variables (very different from the first model I described in the text) and, from these Appetizer that we have learned and the current situation, is able to predict delivery and cooking times. This is how these times vary across times and days — it all depends on the data.

Seeing and controlling all of this are enormous challenges of scale and complexity.

And we need to talk a little about how we will make decisions in this context of optimization. We seek to find the best delivery person for a given order, so that he/she arrives at the correct time at the restaurant to pick up the order and then take it to your home.

How the magic happens

Imagine yourself in the challenge of scheduling a delivery person to deliver pizzas from a specific pizzeria, in a sequence that makes sense, on a route that optimizes the number of stops and mileage, is efficient and respects delivery times. that we made for the customer when we collected the order, in a continuous flow of “birth” of new orders. Complex, a certain crazy Yes, but possible, right?

Now imagine trying to do this with 100 delivery people instead of just one, creating routes that make sense, fulfilling orders on time, ensuring a good SLA Of delivery. Impossible without technology, right?

These decisions on iFood are made minute by minute, on a scale 1,000 times larger (literally) than the last example.

We receive a constant stream of data from all couriers connected to the app iFood for Deliverers with their positions and connectivity status, battery level and other information.

We need to know the entire fleet of delivery people, their positions and who can or cannot pick up an order at this time. If he/she has a very low battery, for example, we may conclude that he/she will not be able to deliver the order until the end, as the cell phone may “die” halfway through. Some things are kind of obvious, but if not thought of, they create a problem.

We also need to know the entire collection of available orders that we promise to deliver, and delivery promises are one of the most important factors for the entire temporal configuration of the route that will be formed in a moment.

Given these two domains of information, orders and delivery people, the optimization algorithm begins to test different hypotheses for creating routes between them, according to the scenario we are seeing at that moment. The objective is to minimize any delay and create shorter routes, thus being able to be more efficient and free the delivery person more quickly for the next delivery.

There are a series of restrictions that also need to be met, such as not choosing a delivery person whose distance to the restaurant is so great as to make delivery unfeasible. on-time of the request.

We also created some grouped order routes, such as when there are 5 pizzas in the delivery person's bag to be delivered to different locations. But we do this in a more expected and scalable way, respecting all temporary configurations of requests that are exclusive to handbag . We will only do this if none of the orders are delayed sooner than we promised you, the consumer.

Oh! And all of this on a global scale, as we already operate in Mexico and Colombia as well. At the same time you order your burger on Saturday night, someone in Mexico orders tacos It is quesadillas. All of these systems and people need to operate on a global scale with the same service level guarantee.

People and purpose

I could go into much more detail, but this has already become a long text and, who knows, it might be a next time.

Everything, exactly everything I mentioned here in a very simplified way, is only possible because of people. People and purpose are what make iFood move as fast as a start-up, and that's why I'm passionate about doing what I do where I do.

Today there are more than 40 product and technology squads looking at the most different facets of this big business, dealing with the depth and complexity of each context, organized into 3 distinct tribes, Customers, Restaurants and Logistics, and divided into chapters of Design, Machine Learning , Back-end, Front-end, Data and Product. Making this all work in an integrated way is wonderful!

We are hiring on several fronts, including my own product and engineering time, which takes care of logistical efficiency and this entire context of optimizing the delivery of your order.

If somehow this challenge of scale and complexity would make you get out of bed horny, maybe there is a vacancy for you. Just go to: https://boards.greenhouse.io/ifood

Was this content useful to you?
YesNo

Related posts