Top 20 IP Addressing and Subnetting Interview Questions
IP addressing and subnetting are among the most common topics in networking interviews because they reveal whether a candidate actually understands how networks communicate. Interviewers often move beyond definitions and ask you to calculate a network address, identify a broadcast address, determine usable hosts, or decide whether two devices are on the same subnet.
This guide covers 20 practical IP addressing and subnetting interview questions, from IPv4 fundamentals and private addresses to CIDR, subnet masks, VLSM, subnetting calculations, and troubleshooting scenarios. The goal is not just to memorize answers, but to understand the logic well enough to explain your reasoning during an interview.
IP Addressing and Subnetting Interview Questions with Answers
1. What is an IP address?
An IP address is a unique numerical label assigned to a device on a network so it can send and receive data. It works similarly to a postal address, telling the network where a packet needs to go and where a reply should be sent back. Every device on a TCP/IP network, from laptops to routers to printers, needs one to communicate.
2. What is the difference between IPv4 and IPv6?
IPv4 uses a 32-bit address written in dotted decimal format like 192.168.1.1, giving roughly 4.3 billion possible addresses. IPv6 uses a 128-bit address written in hexadecimal, like 2001:0db8::1, created largely because the world ran out of available IPv4 addresses. A common mistake candidates make is saying IPv6 was created "to replace subnetting." It wasn't. Subnetting concepts still apply in IPv6, just with different math.

3. What is the structure of an IPv4 address?
An IPv4 address has 32 bits split into four 8-bit octets separated by dots. Each octet ranges from 0 to 255. The address is logically divided into a network portion and a host portion, and the subnet mask determines where that division happens.
4. What is the difference between a public and a private IP address?
A public IP address is routable on the internet and must be globally unique. A private IP address is used inside local networks and isn't routable on the public internet without NAT. For example, a home router might have a public IP like 103.25.10.1 facing the ISP, while every device behind it gets a private address like 192.168.1.10.
5. What are the private IP address ranges defined in RFC 1918?
There are three ranges: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. Candidates often forget the 172.16.0.0/12 range only goes up to 172.31, not the entire 172 range, which is a small but common trap.
6. What is the difference between static and dynamic IP addressing?
A static IP is manually configured and doesn't change, commonly used for servers, printers, and network devices that need a consistent address. A dynamic IP is assigned automatically, usually by DHCP, and can change over time. Dynamic addressing is easier to manage at scale but static addressing is preferred when reliability of the address itself matters.
7. What are Network ID and Host ID?
The Network ID identifies which network a device belongs to, and the Host ID identifies the specific device within that network. The subnet mask tells you exactly where the Network ID ends and the Host ID begins within the 32-bit address.
8. What is a subnet mask?
A subnet mask is a 32-bit value that separates the network portion of an IP address from the host portion. It's written the same way as an IP address, such as 255.255.255.0, and every bit set to 1 represents the network portion while every bit set to 0 represents the host portion.
9. What are the default subnet masks for Class A, B, and C networks?
Class A uses 255.0.0.0 (/8), Class B uses 255.255.0.0 (/16), and Class C uses 255.255.255.0 (/24). These are the traditional classful defaults, though most real networks today use CIDR and subnetting instead of sticking to classful boundaries.
10. What is CIDR notation and why is it used?
CIDR, or Classless Inter-Domain Routing, expresses a subnet mask as a slash followed by the number of network bits, such as /24 instead of 255.255.255.0. It was introduced to replace rigid classful addressing, allowing networks to be sized appropriately instead of wasting large blocks of addresses.
11. What is a network address?
The network address is the first address in a subnet range and identifies the subnet itself. It can't be assigned to any device. For 192.168.1.0/24, the network address is 192.168.1.0.
12. What is a broadcast address, and how is it different from a network address?
The broadcast address is the last address in a subnet range and is used to send data to every device on that subnet. It also can't be assigned to a device. For 192.168.1.0/24, the broadcast address is 192.168.1.255. A frequent mix-up is candidates confusing the two or forgetting both are unusable for host assignment.
13. How do you calculate the number of usable host addresses in a subnet?
The formula is 2^h minus 2, where h is the number of host bits, and the minus 2 accounts for the network and broadcast addresses. A /24 has 8 host bits, so 2^8 minus 2 equals 254 usable hosts.
14. What is subnetting and why is it used?
Subnetting is the process of dividing a larger network into smaller logical networks. It's used to reduce broadcast traffic, improve security through segmentation, make more efficient use of IP address space, and organize networks by department, location, or function instead of dumping every device into one massive flat network.
15. What is VLSM and how is it different from FLSM?
VLSM, or Variable Length Subnet Masking, allows different subnets within the same network to use different subnet masks based on how many hosts they actually need. FLSM, or Fixed Length Subnet Masking, forces every subnet to use the same mask regardless of size requirements, which wastes addresses. VLSM is the standard approach in modern network design because it avoids that waste.
16. How do you find the network address and broadcast address for a given IP and CIDR?
Take the IP 192.168.10.70/26. A /26 mask is 255.255.255.192, giving a block size of 64 in the last octet. The subnet boundaries are 0, 64, 128, and 192. Since 70 falls between 64 and 127, the network address is 192.168.10.64, and the broadcast address is 192.168.10.127, with usable hosts from .65 to .126.
17. If you subnet a Class C network using a /27 mask, how many subnets and hosts per subnet do you get?
A /27 borrows 3 bits from the host portion of a /24, giving 2^3 equals 8 subnets. The remaining 5 host bits give 2^5 minus 2 equals 30 usable hosts per subnet. Each subnet block size is 32 addresses.
18. Given the IP 192.168.10.70/26, what are the network address, broadcast address, and usable range?
This builds directly on question 16. The network address is 192.168.10.64, the broadcast is 192.168.10.127, and usable hosts run from 192.168.10.65 to 192.168.10.126, giving 62 usable addresses. Candidates commonly get the subnet mask right but pick the wrong boundary, so always list out the block increments before answering.
19. How do you determine if two hosts are on the same subnet?
Apply the subnet mask to both IP addresses using a logical AND and compare the results. If the network portion matches, the hosts are on the same subnet and can communicate directly. If it doesn't match, traffic needs to go through a router or default gateway. This trips people up when the mask isn't a clean /24 boundary, so practicing the AND operation in binary really helps.
20. Two devices have correct IP addresses and subnet masks but can't communicate. What would you check?
Start with the default gateway configuration on both devices, since a missing or incorrect gateway blocks traffic to anything outside the local subnet. Then check whether the devices are actually on the same VLAN, whether a firewall rule is blocking traffic, and whether the subnet mask genuinely matches on both ends rather than just looking similar. This is a favorite scenario question because it tests troubleshooting logic, not just definitions.
Quick Subnetting Reference Table
CIDR | Subnet Mask | Usable Hosts | Common Use |
/24 | 255.255.255.0 | 254 | Standard LAN segment |
/25 | 255.255.255.128 | 126 | Splitting a LAN in half |
/26 | 255.255.255.192 | 62 | Department or floor subnet |
/27 | 255.255.255.224 | 30 | Small office subnet |
/28 | 255.255.255.240 | 14 | Small team or lab segment |
/29 | 255.255.255.248 | 6 | Small device groups |
/30 | 255.255.255.252 | 2 | Point-to-point router links |
Quick Subnetting Formulas to Remember
Usable hosts per subnet equals 2^h minus 2, where h is the number of host bits remaining after the mask.
Number of subnets equals 2^s, where s is the number of bits borrowed from the host portion.
The network address is found by rounding the IP down to the nearest multiple of the block size in the octet being subnetted.
Broadcast address is the network address plus the block size, minus 1.
Block size equals 256 minus the value of the subnet mask octet where subnetting occurs.
How to Prepare for IP Addressing and Subnetting Interviews
Practice subnet calculations by hand instead of relying on a calculator, since interviewers often ask you to work through the math out loud. Get comfortable converting between CIDR notation and dotted decimal masks without hesitating. Spend time identifying network and broadcast addresses for random IP and prefix combinations until it becomes automatic.
Work through a handful of real-world subnetting scenarios, like designing an addressing scheme for a small office with multiple departments. Most importantly, focus on explaining why an answer is correct rather than reciting it, since interviewers usually follow up with a variation of the question to test genuine understanding.
Final Thoughts
IP addressing and subnetting questions aren't going anywhere in networking interviews, and for good reason. They reveal whether a candidate actually understands how IPv4 networks are structured or just memorized a set of answers. Once you're comfortable with the math behind network addresses, broadcast addresses, CIDR, and VLSM, these questions stop feeling like a test and start feeling like a normal part of the job you already know how to do.
The founder of Network Kings, is a renowned Network Engineer with over 12 years of experience at top IT companies like TCS, Aricent, Apple, and Juniper Networks. Starting his journey through a YouTube channel in 2013, he has inspired thousands of students worldwide to build successful careers in networking and IT. His passion for teaching and simplifying complex technologies makes him one of the most admired mentors in the industry.



