Reported interview periodNov 2025–Aug 2026
Ordered IPv4 Firewall Rules
Implement an ordered firewall policy for IPv4 addresses.
Practice focusEach rule is [action, cidr] , where action is "ALLOW" or "DENY" . Evaluate rules from top to bottom; the first network containing the address determines the result. If no rule matches, deny access. A rule without a prefix length represents one address, equivalent to /32 . Requirements - Parse and validate dotted-decimal IPv4 addresses and CIDR prefix lengths. - Correctly handle /0 , /32 , network boundaries, and overlapping rules. - Preserve first-match semantics; a more specific later rule does not override an earlier match.…