PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Amazon

Compute minimum delivery days

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic problem-solving skills focused on scheduling, resource allocation, and simulation of constrained delivery processes, testing the ability to model workload distribution and temporal constraints.

  • Medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Compute minimum delivery days

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

##### Question Given N distribution centers numbered 1..N and an orderCityList of length M where orderCityList[i] denotes the city that the i-th order must be delivered to, you may schedule deliveries over multiple days under the following rules: Each day, every center can work on at most one destination city. If a center’s own number equals the destination city’s number, the center can deliver all remaining orders for that city in that single day. If a center’s number differs from the destination city’s number, that center needs two consecutive days to finish delivering all remaining orders for that city (the center is occupied on both days). Return the minimum number of calendar days required to deliver all orders in orderCityList.

Quick Answer: This question evaluates algorithmic problem-solving skills focused on scheduling, resource allocation, and simulation of constrained delivery processes, testing the ability to model workload distribution and temporal constraints.

Related Interview Questions

  • Implement Datacenter Router Commands - Amazon (hard)
  • Replace Delimited Tokens in a String - Amazon (medium)
  • Minimize Circular Redistribution Cost - Amazon (medium)
  • Find the Most Common Visit Pattern - Amazon (hard)
  • Maximize Value Under a Budget - Amazon (medium)
Amazon logo
Amazon
Aug 4, 2025, 10:55 AM
Software Engineer
Take-home Project
Coding & Algorithms
3
0
Question

Given N distribution centers numbered 1..N and an orderCityList of length M where orderCityList[i] denotes the city that the i-th order must be delivered to, you may schedule deliveries over multiple days under the following rules:

Each day, every center can work on at most one destination city.

If a center’s own number equals the destination city’s number, the center can deliver all remaining orders for that city in that single day.

If a center’s number differs from the destination city’s number, that center needs two consecutive days to finish delivering all remaining orders for that city (the center is occupied on both days).

Return the minimum number of calendar days required to deliver all orders in orderCityList.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.