Skip to interview prep
Apexed

34. Evaluate a Feature Rollout

EasyAPI routing

Each request is [account, region, bucket] with an integer bucket from 0 to 99. Each override is [account, enabled], with a Boolean enabled value.

An account override wins even outside the eligible regions. Without an override, enable the request only if its region is eligible and its bucket is less than cutoff. Return the Booleans in request order.

Example 1

Input: requests = [["demo","west",10],["preview","east",99],["new","west",20],["early","west",19]], overrides = [["demo",false],["preview",true]], eligible_regions = ["west"], cutoff = 20
Output: [false,true,false,true]

Example 2

Input: requests = [["sample","east",99],["trial","west",0]], overrides = [], eligible_regions = ["east"], cutoff = 100
Output: [true,false]

Constraints

  • At most 100,000 requests, overrides, and region entries each
  • Override account names are unique. Cutoff is an integer from 0 to 100.

Tab indents · Ctrl/⌘ + Enter runs · Esc then Tab leaves the editor

Run checks these cases; the expected output comes from the reference solution. Submit judges all 5 hidden and sample tests.

Code runs in an isolated browser sandbox. Progress and submissions are saved on this device.

Evaluate a Feature Rollout — coding interview practice — Apexed