Katkat

Implement CIDR firewall matcher

DatabricksSoftware Engineer · Technical Screen

Last updated

This interview question evaluates requirements, scale assumptions, API/data design, architecture, trade-offs, failure modes, and rollout in a realistic interview setting. A strong answer for Implement CIDR firewall matcher states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Question

Design and implement a firewall rule matcher that evaluates a single IPv4 address against a list of CIDR rules (each tagged accept/deny). Explain and code the data structures and algorithms you would use. Follow-up: extend the solution to handle matching an incoming CIDR range against the rule set and discuss efficient data structures for range intersection checks.