PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Coding & Algorithms/Amazon

Find minimum days to deliver all orders

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithm design and combinatorial optimization skills, focusing on scheduling and load-balancing under per-center capacity constraints and frequency-based counting.

  • Medium
  • Amazon
  • Coding & Algorithms
  • Software Engineer

Find minimum days to deliver all orders

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

You manage N delivery centers labeled 1..N and an array orderCityList where each element is the destination city of one order (city IDs are in 1..N). Each calendar day, every center can work on at most one order. If a center’s ID equals the order’s city, that order takes 1 day of that center’s capacity; otherwise it takes 2 days of that center’s capacity (treat it as occupying two days on the assigned center). Orders cannot be split across centers. Compute the minimum number of days required to finish all orders. Example: N=3, orderCityList=[1,1,3,1,1] → 3 days, one optimal assignment by indices is Center1: {1,2,4}, Center2: {5}, Center3: {3}. Design an efficient algorithm (avoid brute force) and analyze its time and space complexity. Implement a function minDays(N, orderCityList) that returns the minimal days.

Quick Answer: This question evaluates algorithm design and combinatorial optimization skills, focusing on scheduling and load-balancing under per-center capacity constraints and frequency-based counting.

Related Interview Questions

  • Count Connected Components in an Undirected Graph - Amazon (medium)
  • Find Unique Target-Sum Pairs - Amazon (easy)
  • Find Valid IP Addresses in Files - Amazon (medium)
  • Implement Optimal Bucket Batching - Amazon (hard)
  • Implement Cache and Rotate Matrix - Amazon (medium)
Amazon logo
Amazon
Sep 6, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
5
0

You manage N delivery centers labeled 1..N and an array orderCityList where each element is the destination city of one order (city IDs are in 1..N). Each calendar day, every center can work on at most one order. If a center’s ID equals the order’s city, that order takes 1 day of that center’s capacity; otherwise it takes 2 days of that center’s capacity (treat it as occupying two days on the assigned center). Orders cannot be split across centers. Compute the minimum number of days required to finish all orders. Example: N=3, orderCityList=[1,1,3,1,1] → 3 days, one optimal assignment by indices is Center1: {1,2,4}, Center2: {5}, Center3: {3}. Design an efficient algorithm (avoid brute force) and analyze its time and space complexity. Implement a function minDays(N, orderCityList) that returns the minimal days.

Comments (0)

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 7,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.