0% found this document useful (0 votes)
16 views1 page

Optimize Delivery Routes with Code

The document describes a scenario where a delivery executive named Aman must optimize the delivery of two orders from different restaurants to two consumers in the shortest time possible. It outlines the use of the haversine formula for calculating travel time and emphasizes the need for production-quality code that adheres to best practices. The goal is to enable efficient cloud storage solutions with minimal human effort.

Uploaded by

aseem.a
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Optimize Delivery Routes with Code

The document describes a scenario where a delivery executive named Aman must optimize the delivery of two orders from different restaurants to two consumers in the shortest time possible. It outlines the use of the haversine formula for calculating travel time and emphasizes the need for production-quality code that adheres to best practices. The goal is to enable efficient cloud storage solutions with minimal human effort.

Uploaded by

aseem.a
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lucidity

“Enabling cloud storage to deliver the highest performance at the lowest possible cost
with zero human effort.”

Best Route:

Imagine a delivery executive called Aman standing idle in Koramangala somewhere when suddenly his
phone rings and notifies that he’s just been assigned a batch of 2 orders meant to be delivered in the
shortest possible timeframe.
All the circles in the figure above represent geo-locations :
● C1 : Consumer 1
● C2 : Consumer 2
● R1 : Restaurant C1 has ordered from. Average time it takes to prepare a meal is pt1
R2 : Restaurant C2 has ordered from. Average time it takes to prepare a meal is pt2

Since there are multiple ways to go about delivering these orders, your task is to help Aman figure out
the best way to finish the batch in the shortest possible time.

For the sake of simplicity, you can assume that Aman, R1 and R2 were informed about these orders at
the exact same time and all of them confirm on doing it immediately. Also, for travel time between
any two geo-locations, you can use the haversine formula with an average speed of 20km/hr (
basically ignore actual road distance or confirmation delays everywhere although the real world is
hardly that simple ;) )

Note: Code should be of production quality and should take into consideration the best practices of
the language chosen

You might also like