Summer Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
14
:
03
:
45
:
14
Back to Dashboard
Shard Rebalancer
Hard
You are implementing a shard management system for a distributed key-value store. Each shard is identified by a string and covers a contiguous range of integer keys, represented as "<id>:<start>:<end>".
To balance load, the system enforces a coverage limit: no key may be covered by more than limit active shards simultaneously. Implement rebalance(limit, shards) which resolves overlaps and fills gaps according to these deterministic rules:
...
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.