← Questions

Feature flags across channels with inheritance

0
CoreWeaveCodingLast asked Jan 2026

A coding interview question asked in CoreWeave's coding round, last asked Jan 2026. It tests hash maps, graphs and inheritance.

Build a feature flag store organized by channels. Each channel has an id, its own map of flag names to true or false, and zero or more parent channels. Looking up a flag on a channel returns the channel's own value if it sets one, otherwise the value from the nearest parent that sets it, and false when no ancestor does.

  1. Implement creating a channel (with its flags and parents), reading a flag, setting a flag on a channel, and deleting a channel.
  2. In production, lookups far outnumber changes. How would you make reads fast?
  3. When a flag changes on one channel, how do you keep lookups correct and fast for every channel that inherits from it, at scale?

Clarifying questions

  • With several parents, which is "nearest": the fewest steps up, with ties broken by parent order?
  • Can parents form a cycle, and must creating a channel reject one?
  • When a channel is deleted, what happens to its children: lose that parent, or inherit its parents?
  • Can a channel clear its own value to go back to inheriting?
  • How many channels and flags are there, and how many reads a second?

What a strong answer covers

  • Part 1: a map from channel to its flags and parents; a lookup is a breadth-first walk up from the channel that returns the first value found, in a fixed tie order; creation rejects unknown parents and cycles.
  • Part 2: cache resolved values per channel and flag, or keep each channel's fully resolved flag map, so a read is O(1).
  • Part 3: reverse edges to children, so a change only touches descendants that do not set the flag themselves; either recompute them eagerly or invalidate them lazily, with a version so readers never mix old and new values; the trade-off between the two at scale.
  • Deletion that updates the children's parents and their cached values.
  • Tests: diamond inheritance, an override in the middle of a chain, deleting a channel in the middle.

Follow-ups

  • Percentage rollouts and targeting by user attributes.
  • Send flags to many servers: push with versions and local caches.
  • Audit and roll back flag changes.

Where it's asked

What it tests

hash maps · graphs · inheritance · caching

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding