← Questions

Single-direction stock rebalancing on a ring

0
AmazonCodingLast asked Jun 2026

A coding interview question asked in Amazon's online assessment, last asked Jun 2026. It tests prefix sums, greedy and circular array.

A company keeps stock in n depots placed around a ring. Depot i is joined to depot (i + 1) % n (the clockwise neighbour) and, through the same link, to depot (i - 1 + n) % n.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Amazon · Online assessment · Last asked Jun 2026Coding problems plus a repository bug-fix section with a built-in assistant or a design scenario, then a work-style survey · AI only inside the bug-fix section's built-in assistant

What it tests

prefix sums · greedy · circular array

Your code and the AI tutor open when you unlock this question.