Interview questions and model answers
"How many usable hosts in a /27? In a /20?"
A /27 leaves 5 host bits: 32 addresses, 30 usable. A /20 leaves 12 host bits: 4,096 addresses, 4,094 usable. In AWS subtract 5 instead of 2, so 27 and 4,091.
"What's the network address of 192.168.10.77/27?"
/27 is a mask of 224 in the last octet, so the block size is 32. Blocks start at 0, 32, 64, 96 — 77 falls in 64 to 95. Network 192.168.10.64, broadcast 192.168.10.95, usable .65 to .94.
"What are the IP classes and are they still used?"
Class A 1–126 with a /8 default mask, B 128–191 with /16, C 192–223 with /24, D 224–239 for multicast, E 240–255 experimental; 127 is loopback. Routing has been classless since CIDR in 1993 because fixed class sizes wasted addresses and bloated routing tables. Classes still explain default masks and the private ranges: 10/8 in Class A space, 172.16/12 in B, 192.168/16 in C.
"Why can't the internet reach my EC2 instance's private IP?"
Private RFC 1918 addresses aren't routable on the internet. Inbound access needs a public or Elastic IP mapped by the internet gateway, or a load balancer in a public subnet. Private instances can go out through a NAT gateway, but NAT only permits outbound-initiated connections.
"How would you size subnets for an EKS cluster?"
With the VPC CNI every pod takes a VPC IP, plus warm IPs per node, so I size for pods, not nodes — typically /19 or /20 private subnets per AZ, a VPC from a planned non-overlapping range, and either prefix delegation for density or a 100.64.0.0/10 secondary CIDR with custom networking for pods. I'd monitor free IPs per subnet and keep the service CIDR non-overlapping.
"You need to connect two VPCs that are both 10.0.0.0/16. What happens?"
Peering and Transit Gateway routing won't work because the ranges overlap — routes would be ambiguous. Options: re-IP one VPC (painful but clean), expose only the needed services through PrivateLink with an NLB, or use NAT-based workarounds. The lesson is central IP planning with something like AWS VPC IPAM from the start.
"Summarise 10.1.0.0/24 and 10.1.1.0/24."
10.1.0.0/23 — two contiguous /24s aligned on a /23 boundary combine into one route covering 10.1.0.0 to 10.1.1.255.