Code RoomFeature flag range tracker
HardPrep Room Coding #1408

Feature flag range tracker

CodingAlgorithms & data structuresSenior–Staff~40 min

Implement a feature-flag rollout tracker that maintains a set of half-open integer ranges [left, right). You are given a list of operations, each one of: ["add", left, right] activates the rollout over that range; ["remove", left, right] deactivates it; ["query", left, right] reports whether the ENTIRE half-open range [left, right) is currently fully active. Process the operations in order and return a list of booleans, one per query operation. Ranges can be added, partially removed, and re-added many times.

Implement
range_module(ops: list[list]) → list[bool]
Examples
in[[["add",10,20],["remove",14,16],["query",10,14],["query",13,15],["query",16,17]]]out[true,false,true]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 40 min
InputExpectedGot
[[["add",10,20],["remove",14,16],["query",10,14],["query",13,15],["query",16,17]]][true,false,true]not run yetsample