Incrementally Find Workloads Affected by a Label Change
Last updated: November 29, 2026
Quick Overview
Workloads carry labels and policy is a list of rules (consumer selector, provider selector). When one workload's labels change, return exactly the set of provider workloads whose set of allowed inbound peers changes, without recomputing the whole policy.
Illumio
November 29, 20260
0
0 solved
Workloads carry labels and policy is a list of rules (consumer selector, provider selector). When one workload's labels change, return exactly the set of provider workloads whose set of allowed inbound peers changes, without recomputing the whole policy.
Relabeling a workload in Illumio can change firewall rules on thousands of other hosts, and the PCE has to figure out which VENs need new policy without recomputing everything. The interviewer wants a correct incremental algorithm that handles a workload being both consumer and provider, and that only reports hosts whose effective policy truly changes.
What the Interviewer Expects
- Keeps a reference count per (provider, consumer) pair, not just a boolean
- Removes the old contribution and adds the new one for the changed workload
- Handles the self pair (workload allowed to reach itself) without double counting
- Reports a provider only when some pair crosses zero
- Uses a label to workload index to evaluate selectors quickly
- Explains cost relative to full recompute
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you batch many label changes into one recompute?
- Rules can also reference IP lists. How do you extend the index?
- How would you turn the changed set into per-VEN policy versions?
- What if a single rule matches 100,000 consumers? How do you avoid materializing pairs?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
count[p][c] is how many rules let consumer c reach provider p. A provider's peer set is the consumers with count above zero. After update_labels(w, labels), return every provider whose peer se...
High-Level Design
Only pairs involving w can change. Subtract w's contribution under its old labels, update the label index, add the contribution under new labels, and remember each touched pair's count before the ...