← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a system to check if an IP address is ALLOWED or DENIED based on an Access Control List (ACL) defined using CIDR notation.
Background:
192.168.1.0/24 represents a range of IP addresses/24 means the first 24 bits are the network portion, remaining 8 bits are host addressesALLOW 10.0.0.0/8 or DENY 192.168.1.0/24Part 1 - Basic CIDR Matching: Given an IP address and a list of CIDR rules, determine if the IP should be ALLOWED or DENIED.
Part 2 - Rule Priority: When multiple rules match, apply proper precedence (most specific wins, or order-based).
Part 3 - Input is CIDR (Follow-up): What if the input is a CIDR range instead of a single IP? An input CIDR should be ALLOWED only if ALL IPs in that range are allowed.
Constraints: