Reported August 2024
Amazongreedy

Minimize Storage Required

Reported by candidates from Amazon's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Amazon OA. Under 2s to a working solution.
Founder's read

Amazon's August 2024 OA included a storage optimization problem that tests your ability to think about space-time tradeoffs. You're likely looking at a compression or consolidation challenge where the naive approach wastes memory. This is a pattern Amazon returns to because it mirrors real infrastructure problems. StealthCoder sits in your corner during the live OA, ready to feed you the insight if you hit a blank on optimization choices.

Pattern and pitfall

Storage minimization problems typically hinge on greedy selection, dynamic programming, or hash-based deduplication. The trick is recognizing what can be merged, discarded, or compressed without losing correctness. Most candidates either over-build (allocate more than needed) or miss a key constraint that unlocks a simpler approach. Amazon weights these heavily because the cost of wasted storage is measurable in their systems. The pattern usually involves iterating through candidates in sorted order, using a frequency map, or applying a greedy choice property. StealthCoder can pattern-match the problem statement in real time and surface the right technique if you're stuck between two approaches.

The honest play: practice the pattern, and have StealthCoder ready for the one you didn't see coming.

If this hits your live OA

You can drill Minimize Storage Required cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Amazon's OA.

Amazon reuses patterns across OAs. Built for the candidate who saw this exact problem leak two days before his OA and wondered if anyone had a play. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Minimize Storage Required FAQ

Is this a DP problem or greedy?+

Usually greedy. Storage problems reward you for making the locally optimal choice at each step. If the problem involves choosing items or merging data, sort first and iterate once. DP appears when you need to track state across choices, but that's less common for storage-specific OAs.

What's the trap candidates fall into?+

Assuming you must keep everything. The real insight is often that some data is redundant or that combining entries saves more space than keeping them separate. Read the constraints carefully. Sometimes a single pass with a frequency map or union-find is enough.

Do I need a fancy data structure?+

Probably not. Hash map, sorted list, and basic arithmetic usually suffice. If you're reaching for a segment tree or heap, you've likely overthought it. Storage problems test logic and constraint parsing, not data structure mastery.

How much time should I spend coding vs. planning?+

Spend 10-15 minutes understanding the input format and what 'minimize' means precisely. Write pseudocode. The implementation is usually a 10-15 line loop. Rushing into code without a clear plan is how candidates miss the trick.

Is this problem still asked in 2024?+

Yes. Amazon revisits storage and resource optimization regularly. The specific twist changes, but the core pattern remains. If you see anything about space, memory, or consolidation, assume greedy or DP and map out your choice sequence before coding.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Amazon.

OA at Amazon?
Invisible during screen share
Get it