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