Amazon | 2026 | Maximum increase in stock | Sum of length k

Amazon · Question · Posted Apr 2026

 Maximum Stock Increase (Max Subarray Sum of Length  K) Problem Statement: Amazon warehouse tracks the daily stock changes of a popular product. You are given an array stockChange of length n, where stockChange[i] is the net change in inventory on the ith day (positive \rightarrow stock added, negative \rightarrow stock removed). Your task is to determine the maximum net increase in stock over any contiguous period of at most k days. If no positive increase is possible, then the answer ...

The full answer & interview discussion are available to premium members.

Log in Create a free account