Amazon SDE I INTERN OA Experience Question Discussion

interview experience logo
interview experience
· SDE I Intern
August 8, 2026 · 0 reads

Summary

I completed an online assessment that asked me to maximize the number of secure deliveries across k warehouses.

Full Experience

Had this question in an Amazon OA.

Question

You are given:

deliveryLogs[] — number of deliveries in each log k — an even number representing the number of warehouses

You have exactly k warehouses.

A warehouse can contain deliveries from only one log. Deliveries from the same log can be split across multiple warehouses. After storing everything, the largest k/2 warehouses are compromised. Only the deliveries in the remaining k/2 warehouses are considered secure.

Find the maximum possible number of secure deliveries.

Interview Questions (1)

1.

Maximum Secure Deliveries

Data Structures & Algorithms

You are given an array deliveryLogs[] where each element represents the number of deliveries in a log, and an even integer k representing the total number of warehouses. You must allocate the deliveries to exactly k warehouses with the following constraints:

  • Each warehouse can contain deliveries from only one log.
  • Deliveries from the same log can be split across multiple warehouses.
  • After allocation, the largest k/2 warehouses are considered compromised.
  • Only the deliveries stored in the remaining k/2 warehouses are counted as secure.

Return the maximum possible number of secure deliveries.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!