Problem · Array

Drone Delivery Route

MediumAmazonFULLTIMENEW GRADOA
See Amazon hiring insights

( ദ്ദി ˙ᗜ˙ ) Special thanks to the friend who shared this fresh last-seen signal! (07-08-26 :D

Amazon is expanding its next-generation drone delivery network, consisting of m hubs arranged in a circular ring. Hub 1 is adjacent to Hub m. A drone can move to either adjacent hub, and the travel time between Hub i and its neighbors is given by transitionTime[i].

1 2 3 m-1 m

Amazon receives a list of priority delivery requests, where packages must be picked up or delivered to specific hubs in a given sequence, represented by the array requestedHubs of size n.

The problem statement continues
Pro
Examples
01 · Example 1
transitionTime = [3,2,1]
requestedHubs = [1,3,3,2]
return = 4

The drone begins its journey at Hub 1.

  1. The first hub to visit is Hub 1 itself, so it takes 0 seconds to complete this step.
  2. To move from Hub 1 to Hub 3, the drone has two possible routes:
    • Clockwise: 1 -> 2 -> 3, which takes transitionTime[1] + transitionTime[2] = 3 + 2 = 5 seconds.
    • Counterclockwise: 1 -> 3, which takes transitionTime[1] = 3 seconds.
    • The shorter route is the counterclockwise path, so the drone reaches Hub 3 in 3 seconds.
  3. The drone is already at Hub 3, so it takes 0 seconds to complete this step.
  4. To move from Hub 3 to Hub 2, the visible source shows the clockwise route 3 -> 2, which takes transitionTime[3] = 1 second.

FastPrep inferred the output 4 from the visible steps: 0 + 3 + 0 + 1 = 4. The screenshot cuts off before the official final output. If you know it, feel free to tell us and we will update it. Thanks a lot in advance! We will also improve this part if we find a clearer source later. (2026-06-24 :)

2 original screenshots from the interview report
Pro
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock the full problem

  • Full problem statement and constraints
  • Worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$9/month

Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week
CodePython 3
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock the full problem

  • Full problem statement and constraints
  • Worked examples, explained
  • Guided hints and editorial
  • Run your code on real test cases
$9/month

Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week