Question: Amazon, On campus recent Online Assessment(OA) Questions | Maximize Inventory & Storage Efficiency | 26th Feb 2025
0
Entering edit mode

Question 1: Maximize Inventory Adjustments

Problem Statement:

An Amazon warehouse processes n shipments, where each shipment affects the inventory levels. These effects are provided in the inventoryAdjustments array, with positive values representing restocks and negative values indicating items taken out for orders.

Starting with zero inventory level, the goal is to process shipments in an optimal order to maximize the number of shipments completed while maintaining a strictly positive inventory level. If the inventory reaches zero or goes negative, operations halt, and no further shipments can be processed.

Given an integer array inventoryAdjustments of length n, find the maximum number of shipments that can be processed without depleting the inventory.

Question 2: Maximum Storage Efficiency

Problem Statement:

You're managing Amazon's cloud storage system. There are n tasks that need to be processed, and the $i^{th}$ task is broken into num_segments[i] segments. The cloud storage is divided into m storage units. The segments are allocated to these units with the following rules:

  1. Each segment is stored in exactly one storage unit.

  2. Each storage unit must hold at least one segment.

  3. A storage unit cannot contain segments from more than one task.

The storage efficiency is measured by the minimum number of segments that any storage unit contains. Your task is to organize the segments in such a way that this storage efficiency is maximized.

ADD COMMENTlink 10 hours ago Aman • 0

Login before adding your answer.

Similar Posts
Loading Similar Posts