Shard Rebalance / Overlapping Key Range

Medium · Coding · 60 min

Manage closed-interval key shards by computing sweep-line coverage, greedily trimming shard start bounds to cap per-key replication at a limit without losing coverage, and supporting dynamic shard additions, removals, and hole filling.

This is a Pro problem. Pro unlocks the full prompt, a step-by-step walkthrough, a reference solution and tests you can run.

See Pro plans

More OpenAI problems