Top 28 Subnetting Interview Questions & Answers (2026)

What changed in 2026 drives
Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.
What I'd actually study for this
- 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
- 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
- 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
- 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken
Where most candidates trip up
The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.
Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.
Subnetting is a core networking skill tested heavily at Cisco, Juniper, network-focused roles at TCS, Infosys, and Wipro, and in GATE examinations. Candidates report that subnetting questions range from straightforward CIDR calculations to complex VLSM design scenarios. Based on public preparation resources and candidate-reported interview accounts, questions on subnet mask arithmetic, VLSM allocation, and supernetting appear most frequently at networking interviews.
Binary and IP Addressing Foundations
Q1. Convert the subnet mask 255.255.240.0 to CIDR prefix length notation. (Easy)
Convert each octet to binary:
- 255 = 11111111
- 255 = 11111111
- 240 = 11110000
- 0 = 00000000
Count the 1-bits: 8 + 8 + 4 + 0 = 20
CIDR notation: /20
Quick reference for common masks:
| Subnet Mask | CIDR | 1-bits Pattern |
|---|---|---|
| 255.0.0.0 | /8 | 8 ones |
| 255.255.0.0 | /16 | 16 ones |
| 255.255.255.0 | /24 | 24 ones |
| 255.255.255.128 | /25 | 25 ones |
| 255.255.255.192 | /26 | 26 ones |
| 255.255.255.224 | /27 | 27 ones |
| 255.255.255.240 | /28 | 28 ones |
| 255.255.255.248 | /29 | 29 ones |
| 255.255.255.252 | /30 | 30 ones |
Q2. What are the classes of IPv4 addresses and their default subnet masks? (Easy)
| Class | First Octet Range | Default Mask | Private Ranges (RFC 1918) |
|---|---|---|---|
| A | 1-126 | /8 (255.0.0.0) | 10.0.0.0/8 |
| B | 128-191 | /16 (255.255.0.0) | 172.16.0.0/12 |
| C | 192-223 | /24 (255.255.255.0) | 192.168.0.0/16 |
| D | 224-239 | Multicast | N/A |
| E | 240-255 | Experimental | N/A |
Special addresses:
- 127.0.0.0/8: Loopback (127.0.0.1 is localhost)
- 169.254.0.0/16: Link-local (APIPA when DHCP fails)
- 0.0.0.0/0: Default route (all destinations)
- 255.255.255.255: Limited broadcast
Q3. Given IP address 192.168.10.75 with subnet mask 255.255.255.192, find the network address, broadcast address, and valid host range. (Easy)
Step 1: Convert to binary and apply AND operation.
192.168.10.75:
- 192 = 11000000
- 168 = 10101000
- 10 = 00001010
- 75 = 01001011
255.255.255.192:
- 255 = 11111111
- 255 = 11111111
- 255 = 11111111
- 192 = 11000000
AND result (network address):
- 11000000 AND 11000000 = 11000000 = 192
Network address: 192.168.10.64
Step 2: Broadcast address - set all host bits to 1.
- Host bits = last 6 (192 = /26, so 32-26=6 host bits)
- 64 in binary = 01000000, set last 6 bits to 1: 01111111 = 127 (wrong, let me redo)
- 64 = 01000000, OR with 00111111 = 01111111 = 127...
- Actually: 64 | (64-1) = 64 | 63 = 127. Broadcast: 192.168.10.127
Step 3: Host range.
- First host: 192.168.10.65
- Last host: 192.168.10.126
- Usable hosts: 2^6 - 2 = 62
Summary:
- Network: 192.168.10.64/26
- Broadcast: 192.168.10.127
- Host range: 192.168.10.65 - 192.168.10.126
- Usable hosts: 62
Q4. How many subnets and hosts are created when you subnet 10.0.0.0/8 with a /12 mask? (Easy)
Original prefix: /8. New prefix: /12. Bits borrowed: 12 - 8 = 4.
Number of subnets: 2^4 = 16
Host bits remaining: 32 - 12 = 20 Hosts per subnet: 2^20 - 2 = 1,048,576 - 2 = 1,048,574
The 16 subnets are:
- 10.0.0.0/12
- 10.16.0.0/12
- 10.32.0.0/12
- 10.48.0.0/12
- ...continuing in increments of 16 in the second octet
- 10.240.0.0/12
CIDR and Subnet Calculations
Q5. What is CIDR and how does it differ from classful addressing? (Easy)
CIDR (Classless Inter-Domain Routing, RFC 4632) removes the rigid Class A/B/C boundaries. With classful addressing, a network had a fixed prefix length based on the first octet. With CIDR, any prefix length from /0 to /32 is valid.
Key differences:
| Feature | Classful | CIDR |
|---|---|---|
| Prefix length | Fixed by class | Arbitrary |
| Routing table size | Large (every Class C separate) | Smaller (route aggregation) |
| Address waste | High | Reduced |
| Example | 200.10.5.0 is always /24 | 200.10.4.0/22 aggregates 4 Class C blocks |
CIDR enables route aggregation (supernetting): multiple contiguous classful networks advertised as a single CIDR block, reducing routing table entries.
Q6. A company needs 500 hosts in one subnet and 50 hosts in another. Allocate subnets from 172.16.0.0/16. (Medium)
This is a VLSM allocation problem.
For 500 hosts: Need at least 502 addresses (500 + network + broadcast). Smallest power of 2 >= 502 is 512 = 2^9, so 9 host bits. Prefix: /23 (32 - 9 = 23). Subnet: 172.16.0.0/23
- Network: 172.16.0.0
- Broadcast: 172.16.1.255
- Hosts: 172.16.0.1 - 172.16.1.254 (510 usable)
For 50 hosts: Need at least 52 addresses (50 + network + broadcast). Smallest power of 2 >= 52 is 64 = 2^6, so 6 host bits. Prefix: /26 (32 - 6 = 26). Subnet: 172.16.2.0/26
- Network: 172.16.2.0
- Broadcast: 172.16.2.63
- Hosts: 172.16.2.1 - 172.16.2.62 (62 usable)
VLSM allocation table:
| Purpose | Subnet | Usable Hosts | Block Size |
|---|---|---|---|
| Large segment | 172.16.0.0/23 | 510 | 512 |
| Small segment | 172.16.2.0/26 | 62 | 64 |
| Next available | 172.16.2.64 | - | - |
Q7. What is VLSM? How does it improve IP address utilization? (Medium)
VLSM (Variable Length Subnet Masking) allows a single classful network to be divided into subnets of different sizes by using different prefix lengths within the same major network.
Without VLSM (fixed-length subnetting): If a network needs subnets of 100, 50, 10, and 2 hosts, fixed subnetting wastes addresses. Using /25 for all subnets (126 hosts each) wastes 76 addresses in the 50-host subnet, 116 in the 10-host subnet, and 124 in the 2-host subnet.
With VLSM:
Network: 192.168.1.0/24
Requirement Subnet Block Usable
100 hosts -> 192.168.1.0/25 128 126
50 hosts -> 192.168.1.128/26 64 62
10 hosts -> 192.168.1.192/28 16 14
2 hosts -> 192.168.1.208/30 4 2
(WAN link)
Remaining space: 192.168.1.212 - 192.168.1.255 (44 addresses for future use).
Rule: Allocate largest subnets first, then carve smaller ones from remaining space. Always subnet on binary boundaries.
Q8. Explain the concept of a "magic number" in subnetting calculations. (Medium)
The magic number (also called block size or subnet increment) is the size of each subnet in terms of addresses. It tells you the starting address of each subsequent subnet.
Calculation: Magic number = 256 - (interesting octet value of the subnet mask)
The "interesting octet" is the last non-255, non-0 octet of the subnet mask.
Examples:
| Subnet Mask | Interesting Octet | Magic Number | Subnets start at... |
|---|---|---|---|
| 255.255.255.192 | 192 | 64 | 0, 64, 128, 192 |
| 255.255.255.224 | 224 | 32 | 0, 32, 64, 96, 128... |
| 255.255.255.240 | 240 | 16 | 0, 16, 32, 48... |
| 255.255.240.0 | 240 (3rd octet) | 16 | 0.0, 16.0, 32.0... |
Using the magic number to find subnet: For IP 10.20.35.100 with mask 255.255.240.0 (magic = 16, interesting in 3rd octet):
- 35 / 16 = 2 remainder 3. So subnet is at 10.20.32.0 (2 * 16 = 32).
- Broadcast: 10.20.47.255 (32 + 16 - 1 = 47).
Q9. Is 172.16.5.0/20 a valid subnet? What is its network address? (Medium)
Check if /20 is valid for this address. A /20 mask has block size 16 in the third octet (256 - 240 = 16). Valid network addresses in the third octet are: 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240.
Third octet = 5. Is 5 a multiple of 16? No (5 / 16 = 0 remainder 5).
172.16.5.0/20 is NOT a valid subnet. It is a host address within the 172.16.0.0/20 network.
The network that contains 172.16.5.0 with /20:
- Third octet: 5 / 16 = 0 (integer division). Network third octet = 0 * 16 = 0.
- Network address: 172.16.0.0/20
- Broadcast: 172.16.15.255
- Host range: 172.16.0.1 - 172.16.15.254
Q10. Divide 192.168.0.0/24 into exactly 8 equal subnets. List all of them. (Medium)
8 subnets = 2^3, so borrow 3 bits. New prefix = 24 + 3 = /27. Block size = 32.
| Subnet | Network Address | Broadcast | Host Range | Usable Hosts |
|---|---|---|---|---|
| 1 | 192.168.0.0 | 192.168.0.31 | .1 - .30 | 30 |
| 2 | 192.168.0.32 | 192.168.0.63 | .33 - .62 | 30 |
| 3 | 192.168.0.64 | 192.168.0.95 | .65 - .94 | 30 |
| 4 | 192.168.0.96 | 192.168.0.127 | .97 - .126 | 30 |
| 5 | 192.168.0.128 | 192.168.0.159 | .129 - .158 | 30 |
| 6 | 192.168.0.160 | 192.168.0.191 | .161 - .190 | 30 |
| 7 | 192.168.0.192 | 192.168.0.223 | .193 - .222 | 30 |
| 8 | 192.168.0.224 | 192.168.0.255 | .225 - .254 | 30 |
Total hosts: 8 * 30 = 240 usable (original had 254 usable; 14 lost to subnet/broadcast overhead).
Supernetting and Route Aggregation
Q11. What is supernetting? Aggregate these networks: 192.168.8.0/24, 192.168.9.0/24, 192.168.10.0/24, 192.168.11.0/24. (Medium)
Supernetting (route aggregation, CIDR summarization) combines multiple smaller networks into a single larger network advertisement. This reduces routing table size.
Conditions for aggregation:
- Networks must be contiguous (adjacent in address space)
- Block size must be a power of 2
- The first network address must be on a boundary aligned to the aggregate block size
Example aggregation: Networks: 192.168.8.0, 192.168.9.0, 192.168.10.0, 192.168.11.0
Third octets in binary:
- 8 = 00001000
- 9 = 00001001
- 10 = 00001010
- 11 = 00001011
Common bits: 00001000 through 00001011 share the first 6 bits: 000010xx
Total prefix: first 2 octets (/16 base) + 6 bits from third octet = 22 bits.
Aggregate: 192.168.8.0/22
Verification:
- Network: 192.168.8.0
- Broadcast: 192.168.11.255
- Covers exactly the 4 original /24 networks.
Route summarization impact: 4 routing table entries compressed to 1.
Q12. Can you always aggregate contiguous networks? What can go wrong? (Hard)
No, aggregation requires strict alignment. Problems arise when:
1. Not power-of-2 count: Three networks (192.168.1.0, 192.168.2.0, 192.168.3.0) cannot be aggregated into one prefix. You need either aggregate to 192.168.0.0/22 (4 networks, including 192.168.0.0/24 which you may not own) or use two separate prefixes.
2. Misaligned start: 192.168.3.0/24 and 192.168.4.0/24 cannot aggregate to /23 because 192.168.3.0/23 = third octet 3, which is odd. /23 boundaries are on even numbers. They must aggregate differently.
Actually: 192.168.3.0/23 would contain 192.168.3.x and 192.168.4.x only if 3 is on a /23 boundary. Check: 3 is odd, so not on /23 boundary. 192.168.4.0 is on /23 boundary (4 is even). These two cannot form a /23.
3. Ownership boundaries: An ISP cannot aggregate customer address blocks that span addresses owned by different customers without creating incorrect routing.
Discontiguous supernet problem: If a router advertises a supernet but does not own all addresses within it, traffic for the "gaps" gets black-holed. Solution: null-route the unowned gaps pointing to Null0.
ip route 0.0.0.0 0.0.0.0 [next-hop] # default
ip route 192.168.8.0 255.255.252.0 Null0 # black-hole the supernet gaps
ip route 192.168.8.0 255.255.255.0 [interface] # specific routes win
WAN Links and Special Cases
Q13. What subnet mask do you use for a point-to-point WAN link? Why? (Easy)
Use /30 (255.255.255.252) for point-to-point links.
A /30 provides 4 addresses:
- 1 network address
- 2 usable host addresses (one per endpoint)
- 1 broadcast address
This is the minimum subnet that supports two routers with IP addresses.
Example: WAN link: 10.0.0.0/30
- Router A: 10.0.0.1
- Router B: 10.0.0.2
- Network: 10.0.0.0
- Broadcast: 10.0.0.3
Even more efficient: /31 (RFC 3021) provides only 2 addresses with no network or broadcast address, usable specifically for point-to-point links. Some routers support this.
Loopback interfaces typically use /32 (single host) for router IDs in OSPF and BGP.
Q14. What is the difference between a network address and a broadcast address? (Easy)
Network address: First address in a subnet, all host bits set to 0. Identifies the subnet itself. Cannot be assigned to a host. Used in routing table entries.
Broadcast address: Last address in a subnet, all host bits set to 1. Packets sent to this address are delivered to all hosts on the subnet. Cannot be assigned to a host.
Example for 192.168.5.0/25:
- Subnet mask: 255.255.255.128
- Network: 192.168.5.0 (last 7 bits = 0000000)
- Broadcast: 192.168.5.127 (last 7 bits = 1111111)
- Host range: 192.168.5.1 - 192.168.5.126
Types of broadcast:
- Limited broadcast: 255.255.255.255 (not forwarded by routers)
- Directed broadcast: network's broadcast address (e.g., 192.168.1.255 for 192.168.1.0/24); can be forwarded; disabled by default on Cisco routers (no ip directed-broadcast)
Q15. A /30 subnet starting at 10.1.1.4 -- what are the usable host addresses? (Easy)
/30 = 255.255.255.252. Block size = 4. Valid /30 subnets starting at multiples of 4:
- 10.1.1.0/30: network .0, broadcast .3, hosts .1-.2
- 10.1.1.4/30: network .4, broadcast .7, hosts .5-.6
- 10.1.1.8/30: network .8, broadcast .11, hosts .9-.10
For 10.1.1.4/30:
- Network: 10.1.1.4
- Usable hosts: 10.1.1.5 and 10.1.1.6
- Broadcast: 10.1.1.7
Verify: 4 is a multiple of 4? 4/4 = 1. Yes, valid subnet boundary.
VLSM Design Problems
Q16. Design a subnetting scheme for this network: 10.10.0.0/16. Requirements: Segment A needs 1000 hosts, Segment B needs 500 hosts, Segment C needs 250 hosts, Segment D needs 100 hosts, and 3 WAN links. (Hard)
Process: allocate largest first.
Segment A (1000 hosts): Need 1002 addresses. 2^10 = 1024 > 1002. Prefix: /22 (32-10=22). Subnet: 10.10.0.0/22
- Range: 10.10.0.1 - 10.10.3.254 (1022 hosts)
- Next available: 10.10.4.0
Segment B (500 hosts): Need 502. 2^9 = 512 > 502. Prefix: /23 (32-9=23). Subnet: 10.10.4.0/23
- Range: 10.10.4.1 - 10.10.5.254 (510 hosts)
- Next available: 10.10.6.0
Segment C (250 hosts): Need 252. 2^8 = 256 > 252. Prefix: /24 (32-8=24). Subnet: 10.10.6.0/24
- Range: 10.10.6.1 - 10.10.6.254 (254 hosts)
- Next available: 10.10.7.0
Segment D (100 hosts): Need 102. 2^7 = 128 > 102. Prefix: /25 (32-7=25). Subnet: 10.10.7.0/25
- Range: 10.10.7.1 - 10.10.7.126 (126 hosts)
- Next available: 10.10.7.128
Three WAN links (/30 each):
- WAN1: 10.10.7.128/30 (hosts .129, .130)
- WAN2: 10.10.7.132/30 (hosts .133, .134)
- WAN3: 10.10.7.136/30 (hosts .137, .138)
- Next available: 10.10.7.140
Allocation summary:
| Segment | Subnet | Required | Allocated | Waste |
|---|---|---|---|---|
| A | 10.10.0.0/22 | 1000 | 1022 | 22 |
| B | 10.10.4.0/23 | 500 | 510 | 10 |
| C | 10.10.6.0/24 | 250 | 254 | 4 |
| D | 10.10.7.0/25 | 100 | 126 | 26 |
| WAN1 | 10.10.7.128/30 | 2 | 2 | 0 |
| WAN2 | 10.10.7.132/30 | 2 | 2 | 0 |
| WAN3 | 10.10.7.136/30 | 2 | 2 | 0 |
Q17. Given 172.20.0.0/14, how many /24 networks can be carved out? (Medium)
/14 to /24: difference = 10 bits. Number of /24 networks = 2^10 = 1024.
Verification:
- /14 block size: 2^(32-14) = 2^18 = 262,144 addresses
- /24 block size: 2^(32-24) = 2^8 = 256 addresses
- Count: 262,144 / 256 = 1024 subnets. Confirmed.
Address range of 172.20.0.0/14:
- Mask: 255.252.0.0
- Network: 172.20.0.0
- Broadcast: 172.23.255.255
- /24 subnets from 172.20.0.0/24 through 172.23.255.0/24
IPv6 Subnetting
Q18. How does IPv6 subnetting differ from IPv4? (Medium)
IPv6 addresses are 128 bits vs IPv4's 32 bits. CIDR notation still applies but the default for a LAN is /64 (standard practice).
IPv6 address structure:
|<------ 64 bits ------>|<------ 64 bits ------>|
Global routing prefix Interface identifier
(network portion) (host portion)
Typical allocation:
- ISP gets /32 from RIR
- ISP assigns /48 to each customer
- Customer uses /48 to allocate /64 subnets
- Each /64 can hold 2^64 hosts (EUI-64 auto-configuration uses 64 host bits)
Key differences:
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Notation | Dotted decimal | Colon-hexadecimal |
| No broadcast | Has broadcast | No broadcast (uses multicast) |
| Standard LAN prefix | /24 (common) | /64 (mandatory for SLAAC) |
| Loopback | 127.0.0.1/8 | ::1/128 |
| Private/ULA | RFC 1918 | fc00::/7 (ULA) |
| Link-local | 169.254.0.0/16 | fe80::/10 |
IPv6 subnetting example: Given 2001:db8:abcd::/48, allocate /64 subnets:
- 2001:db8:abcd:0000::/64
- 2001:db8:abcd:0001::/64
- ...
- 2001:db8:abcd:ffff::/64
Total: 2^16 = 65,536 /64 subnets from one /48.
Q19. A company is given 2001:0db8:0001::/48. How many /64 subnets can they create? Show one subnet's full address range. (Medium)
From /48 to /64: difference = 16 bits. Number of /64 subnets = 2^16 = 65,536.
Example subnet: 2001:0db8:0001:0042::/64
- Network: 2001:0db8:0001:0042:0000:0000:0000:0000
- First host: 2001:0db8:0001:0042:0000:0000:0000:0001
- Last host: 2001:0db8:0001:0042:ffff:ffff:ffff:ffff
- No broadcast (IPv6 uses multicast)
- Usable hosts: 2^64 - 1 (theoretical; excluding network address itself)
In practice, the all-zeros interface ID and the subnet-router anycast address (all-zeros for interface) are reserved, but with 2^64 addresses this is purely theoretical.
IPv6 address compression rules:
- Leading zeros in each group can be omitted: 0042 -> 42
- One consecutive run of all-zero groups can be replaced with ::
- Example: 2001:0db8:0001:0042:0000:0000:0000:0001 = 2001:db8:1:42::1
Network Design and Practical Scenarios
Q20. How do you determine if two IP addresses are in the same subnet? (Easy)
Perform bitwise AND between each IP address and the subnet mask. If both results are equal, the addresses are in the same subnet.
Example:
- IP1: 192.168.1.100
- IP2: 192.168.1.200
- Mask: 255.255.255.0 (/24)
IP1 AND Mask:
- 192.168.1.100 AND 255.255.255.0 = 192.168.1.0
IP2 AND Mask:
- 192.168.1.200 AND 255.255.255.0 = 192.168.1.0
Same result = same subnet. They can communicate directly without a router.
Counterexample with /25:
- IP1: 192.168.1.100, IP2: 192.168.1.200, Mask: /25 (255.255.255.128)
- IP1 AND Mask = 192.168.1.0 (first half: .0-.127)
- IP2 AND Mask = 192.168.1.128 (second half: .128-.255)
- Different subnets: they need a router to communicate.
Q21. What is a subnet calculator and when would you use one in production? (Easy)
A subnet calculator is a tool (online or CLI) that automates subnet math: given an IP and mask, it returns network address, broadcast, host range, usable hosts, and adjacent subnets.
CLI example (ipcalc):
ipcalc 192.168.10.0/26
# Network: 192.168.10.0/26
# Broadcast: 192.168.10.63
# HostMin: 192.168.10.1
# HostMax: 192.168.10.62
# Hosts/Net: 62
Production use cases:
- IP address management (IPAM) systems like NetBox automate subnet tracking
- Network engineers use it to verify configurations before pushing to devices
- Troubleshooting: confirm a host's subnet membership before checking routing
- Capacity planning: knowing remaining free blocks in an address plan
Important: In interviews, demonstrate you can do the math mentally or on paper. Subnet calculator reliance without understanding shows shallow knowledge.
Q22. Explain the concept of a "host route" and a "default route." (Medium)
Host route: A route with /32 prefix length (IPv4) or /128 (IPv6) matching exactly one IP address. Used for:
- Loopback interfaces on routers (OSPF router-ID)
- Policy-based routing to specific hosts
- Overriding an aggregate route for one host
Default route: 0.0.0.0/0 (IPv4) or ::/0 (IPv6). Matches any destination not matched by a more specific route. Points to the gateway of last resort.
Longest prefix match rule: When multiple routes match a destination, the router selects the one with the longest (most specific) prefix.
Routing table:
192.168.0.0/16 -> Router A
192.168.1.0/24 -> Router B
192.168.1.5/32 -> Router C
0.0.0.0/0 -> ISP router
Packet to 192.168.1.5: goes to Router C (/32 wins)
Packet to 192.168.1.99: goes to Router B (/24 wins)
Packet to 192.168.5.1: goes to Router A (/16 wins)
Packet to 8.8.8.8: goes to ISP router (/0, default route)
Q23. What is RFC 1918 and why does it matter for subnetting design? (Medium)
RFC 1918 defines private IPv4 address space that is not routable on the public internet:
- 10.0.0.0/8 (Class A private, 16.7 million addresses)
- 172.16.0.0/12 (Class B private range, 1.05 million addresses, covers 172.16.x.x through 172.31.x.x)
- 192.168.0.0/16 (Class C private, 65,536 addresses)
Why it matters for design:
-
NAT requirement: Private addresses require Network Address Translation to reach the internet. Routers at the edge translate private to public IP.
-
Address conservation: With IPv4 exhaustion, private addressing + NAT allowed the internet to grow far beyond 4.3 billion theoretical addresses.
-
Design choice:
- Large enterprises: use 10.0.0.0/8 (massive space for VLSM)
- Medium networks: use 172.16.0.0/12
- Small offices/home: use 192.168.0.0/16
-
Overlapping VPNs problem: When merging two companies or connecting VPNs, overlapping RFC 1918 space creates routing conflicts. Careful address planning prevents this.
Overlap scenario:
- Company A: 10.0.0.0/8 internally
- Company B: 10.0.0.0/8 internally
- Merging: need NAT-on-a-stick or re-addressing. Expensive.
Q24. How does DHCP interact with subnetting? (Easy)
DHCP (Dynamic Host Configuration Protocol) assigns IP addresses to hosts from a configured pool within a subnet.
DHCP server configuration ties to subnetting:
- Scope: defines the subnet (e.g., 192.168.1.0/24)
- Range: usable host addresses to hand out (e.g., .100 - .200)
- Exclusions: static reservations for servers, printers
- Gateway: one entry, typically the router interface IP
- Lease time: duration of the assignment
DHCP and subnets: A DHCP server can serve multiple subnets using either:
- One server per subnet (simple but less scalable)
- DHCP relay agent (ip helper-address on Cisco): routers forward DHCP broadcasts to a centralized DHCP server on another subnet as unicast. The server uses the relay agent's IP (giaddr field) to determine which scope to serve.
Important: DHCP leases are within the subnet. A host in 192.168.1.0/24 will only receive an address from the 192.168.1.x scope, not from 192.168.2.x.
Q25. A network scan returns the address 10.0.0.255 in a /16 network. Is this the broadcast? (Medium)
No. In 10.0.0.0/16, the broadcast address is 10.0.255.255, not 10.0.0.255.
Explanation:
- /16 mask: 255.255.0.0
- Host bits: last 16 bits
- All host bits set to 1: 00000000.00000000.11111111.11111111
- That is: 10.0.255.255
10.0.0.255 is the broadcast of the /24 subnet 10.0.0.0/24, but in a /16 network it is just a regular host address.
Common mistake: Assuming the last 255 in any position is the broadcast. Broadcast depends on the subnet mask, not just the last octet.
Test:
- 10.0.0.0/16: broadcast = 10.0.255.255
- 10.0.0.0/24: broadcast = 10.0.0.255
- 10.0.0.0/25: broadcast = 10.0.0.127
Q26. What is a "discontiguous network" and what problem does it cause? (Hard)
A discontiguous network occurs when subnets of the same major network (classful boundary) are separated by subnets belonging to a different major network. This commonly happened in classful routing protocols.
Visual:
Site A Core Router Site B
10.1.1.0/24 --- [172.16.1.0/24] --- 10.2.2.0/24
Both 10.x networks are part of major network 10.0.0.0/8 (Class A)
but separated by the 172.16.x.x network.
Problem with classful routing protocols (RIPv1, IGRP): These protocols summarize routes at classful boundaries. Both sites advertise "10.0.0.0/8" to the core router. The core sees two paths to 10.0.0.0/8 and load-balances, sending some packets to the wrong site.
Solutions:
- Use classless routing protocols (OSPF, EIGRP, RIPv2, BGP) that carry prefix length in updates
- Disable auto-summarization:
no auto-summaryin EIGRP/RIPv2 - Redesign address plan to eliminate discontiguous subnets
Q27. In binary, what is the subnet mask for /19? Calculate an example subnet. (Hard)
/19 in binary: 11111111.11111111.11100000.00000000 = 255.255.224.0
Block size in third octet: 256 - 224 = 32. Valid third-octet values: 0, 32, 64, 96, 128, 160, 192, 224.
Example: is 172.17.68.0/19 valid? Third octet = 68. Is 68 a multiple of 32? 68/32 = 2 remainder 4. No, 68 is not on a /19 boundary. Closest valid boundary below 68: 64. Subnet: 172.17.64.0/19.
172.17.64.0/19:
- Network: 172.17.64.0
- Broadcast: 172.17.95.255 (64 + 32 - 1 = 95 in third octet)
- Host range: 172.17.64.1 - 172.17.95.254
- Usable hosts: 2^13 - 2 = 8,190
Host count check: 32-19 = 13 host bits. 2^13 = 8,192. Minus 2 = 8,190.
Q28. A router receives two routes: 10.5.4.0/22 and 10.5.6.0/24. A packet arrives for 10.5.6.150. Which route wins and why? (Hard)
The /24 route wins by the longest prefix match rule.
Verify that both routes match 10.5.6.150:
10.5.4.0/22 check:
- Mask: 255.255.252.0
- 10.5.6.150 AND 255.255.252.0: third octet 6 AND 252 = 4 (00000110 AND 11111100 = 00000100)
- Result: 10.5.4.0. This matches the route 10.5.4.0/22. Yes, 10.5.6.150 is within the /22.
10.5.6.0/24 check:
- Mask: 255.255.255.0
- 10.5.6.150 AND 255.255.255.0 = 10.5.6.0. Matches exactly.
Both routes match. Longest prefix (/24) is more specific than /22. Packet forwarded via the /24 route.
Intuition: /24 covers only 256 addresses, while /22 covers 1,024 addresses. The /24 "knows more" about how to reach 10.5.6.x specifically.
Longest prefix match is why supernetting works without black-holing: Specific routes override the aggregate, while the aggregate catches traffic for gaps.
Frequently Asked Questions
Q: What is the fastest mental subnetting method for interviews? Practice the magic number method: identify the interesting octet, compute 256 minus that octet value, and count multiples to find subnets quickly without binary conversion.
Q: Why can't I use 0 and 255 as host addresses? In the same octet, yes, but all-zeros host bits = network address and all-ones host bits = broadcast address for that subnet. So 192.168.1.0 and 192.168.1.255 in a /24 are reserved. However, 10.0.0.0 and 10.255.255.255 are still valid hosts in a /16 subnet.
Q: What is the difference between a subnet and a VLAN? Subnetting is Layer 3 (IP division). VLANs are Layer 2 (logical switch port groupings). Typically one subnet corresponds to one VLAN, but they are separate concepts. Inter-VLAN routing requires a Layer 3 device (router or Layer 3 switch with SVIs).
Q: How many bits of a /30 are host bits? 32 - 30 = 2 host bits. This gives 2^2 = 4 total addresses, with 2 usable hosts.
Q: Is VLSM required for modern routing protocols? VLSM requires classless routing protocols (OSPF, EIGRP, RIPv2, BGP). All modern protocols support it. Only legacy protocols (RIPv1, IGRP) do not; they are obsolete.
Q: Where does subnetting appear in GATE and competitive exams? Subnetting problems appear regularly in GATE CS networking sections, typically as calculation questions requiring network address, broadcast, and host count determination. VLSM allocation problems also appear.
Internal Links
Methodology applied to this articlelast verified 8 Jun 2026
- No fabricated salary numbers or success rates. If we quote a range, it's sourced.
- No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
- No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Explore this topic cluster
More resources in Interview Questions
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
Paid contributor programme
Sat this this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.
Submit your story →Ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.
Start Free Mock Test →Related Articles
Airbnb Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airbnb's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Airtel Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airtel's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
AMD Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing AMD's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Atlassian Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Atlassian's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical,...
Barclays Interview Questions 2026
_Last verified by [Aditya Sharma](/author/aditya-sharma/) · cross-checked against PapersAdda Hiring Pulse and...
More from PapersAdda
Accenture Interview Questions 2026 (with Answers for Freshers)
Capgemini Interview Questions 2026 (with Answers for Freshers)
HCLTech Interview Questions 2026 (TechBee + TGT, with Answers)
IBM Interview Questions 2026 (with Answers for Freshers)