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 minFrontend Engineer

Notifications Greedy Load Rebalancer

Frontend Engineer signal: greedy proof + sorting in a in-app notification tray context. This is a ProdMatch-owned frontend engineer drill, framed as a March 2026 Cars24 Engagement UX simulation, not a copied platform question.

Company context

Cars24 · Engagement UX

Freshness

March 2026

Product surface

in-app notification tray

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

Question

Rebalance notifications across shards for in-app notification tray. 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

  • render scheduling
  • state graphs
  • virtualization
  • 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

Timeline Greedy Load RebalancermediumAutocomplete Greedy Load RebalancermediumCanvas Greedy Load Rebalancerhard