ProdMatch
CompaniesCitiesRolesSign in

Companies

  • Google
  • Microsoft
  • Meta
  • Amazon
  • Apple
  • Atlassian
  • Nvidia
  • Oracle
  • See all 51 →

Cities

  • Bengaluru jobs
  • Hyderabad jobs
  • Pune jobs
  • Gurugram jobs
  • Noida jobs
  • Delhi NCR jobs
  • Mumbai jobs
  • Chennai jobs
  • Remote-India jobs

Roles

  • QA / SDET Engineers
  • Backend Engineers
  • Frontend Engineers
  • Full-stack Engineers
  • Data Analysts
  • Data Engineers
  • ML / AI Engineers
  • DevOps / SRE Engineers
  • All roles →

ProdMatch

  • About
  • Career guides
  • Compare
  • Salaries
  • Skills
  • DSA practice
  • Privacy
  • Terms
  • Sign in

© 2026 ProdMatch.ai · Built for India · DPDP Act 2023 compliant · Job data sourced from official company career pages.

Back to DSA
Greedymedium45 minDevOps / SRE Engineer

Logs Greedy Load Rebalancer

DevOps / SRE Engineer signal: greedy proof + sorting in a log compaction context. This is a ProdMatch-owned devops sre drill, framed as a May 2026 Intuit Observability simulation, not a copied platform question.

Company context

Intuit · Observability

Freshness

May 2026

Product surface

log compaction

ProdMatch interview simulation based on product-team patterns; not a claim of a real company question.

Question

Rebalance spans across shards for log compaction. Each move has a cost equal to distance between shards. Compute minimum cost to make shard loads differ by at most one.

Input

  • Array of shard loads.

Output

  • Minimum movement cost.

Constraints

  • 1 <= shards <= 200000
  • Total load <= 1e12

Concepts

  • blast-radius graphs
  • alert dedupe
  • rolling windows
  • greedy proof
  • sorting
  • load balancing

loads [0,3,0] -> move one unit left and one right, cost=2

Approach

Try framing your own approach first. The 30 seconds you think before peeking is where learning happens.

Clean Solution

Reveal the approach first.

How well did you understand?

Your rating tunes when this problem shows up again.

Common Mistakes

  • A greedy idea without a proof may fail hidden cases.
  • Do not mutate sorted keys in a way that breaks ordering.

Next Similar Problems

Incident Greedy Load RebalancermediumDeploy Greedy Load RebalancermediumCapacity Greedy Load Rebalancerhard