Skip to content
Tech Interview Prep
Technical interview guide

Cloud Networking Fundamentals

VPCs, subnets, and security groups: the building blocks every other cloud topic assumes.

Minutes to read
4
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: Vendor-neutral fundamentals with AWS VPC terminology and official references accessed 2026-08-30..

Overview

Curated: · Written: · Reviewed:

Cloud Networking Fundamentals

In one line

A VPC is a routing and isolation boundary, and a subnet is an address range inside one availability zone. Routes decide where a packet goes; security groups and network ACLs decide whether it may pass. Reach for this model whenever you design or debug reachability for a cloud workload.

Key definitions

  • VPC: logically isolated virtual network. Its router applies the route table associated with each subnet.
  • Subnet: address range placed in one availability zone.
  • Public subnet: a subnet whose route table sends 0.0.0.0/0 to an attached internet gateway. The name does not make it public.
  • Security group: stateful filter on a network interface. Reply traffic for an allowed connection is tracked automatically.
  • Network ACL: stateless filter at the subnet boundary. Inbound and outbound are evaluated separately.
  • NAT gateway: lets private IPv4 workloads start outbound connections. It admits no unsolicited inbound traffic.

Formulas and complexity

addresses in a /p block=232−p\text{addresses in a /}p\text{ block} = 2^{32-p} /24s in a /16=224−16=256\text{/24s in a /16} = 2^{24-16} = 256 /26s in a /22=226−22=4, each with 232−26=64 addresses\text{/26s in a /22} = 2^{26-22} = 4, \text{ each with } 2^{32-26} = 64 \text{ addresses}

AWS reserves five addresses per subnet, so a /24 leaves 251 usable addresses.

How it works

The route lookup selects the most specific matching prefix. The source filter and destination filter then apply, and the reply path needs its own route and filter.

10.0.0.0/16 local 0.0.0.0/0 to IGW no yes Instance ENI 10.0.1.42 Subnet route table: most specific match Local VPC delivery Internet gateway Public IPv4 on ENI? No usable return path Network ACL then security group
  • A route decides where traffic goes. Filters decide whether it passes.
  • Internet reachability for IPv4 needs a 0.0.0.0/0 route to an IGW, a public address, and permitting filters. Missing any one of them fails the flow.
  • Security groups track replies. Network ACLs need explicit rules for ephemeral return ports.

When to use and when not to

OptionUse whenAvoid when
VPC peeringTwo networks, few connections, non-overlapping CIDRsYou need transitive routing across many networks
Transit hubMany VPCs plus on-premises, central policy or inspectionOne pair of networks where a shared dependency is unwanted
NAT gatewayPrivate IPv4 workloads need outbound internet accessAnything must accept unsolicited inbound connections
S3 gateway endpointPrivate workloads need S3 without public egressTraffic must pass through a firewall or egress proxy
Security group referencing another groupWorkload IPs change, such as with autoscalingThe source is outside the VPC
Network ACL rulesCoarse subnet guardrail or emergency denyPer-workload policy, which is hard to misorder and debug

Traps interviewers probe

  1. Trusting the subnet name. Fix: check the effective route table for 0.0.0.0/0 to an IGW, then confirm a public IPv4 address on the ENI.
  2. Blocking ephemeral return ports in a network ACL. Replies leave on a high port, so a stateless outbound rule that allows only the service port drops them. Fix: allow the ephemeral range outbound, or rely on a stateful security group.
  3. Assuming peering is transitive. If A peers with B and B peers with C, A cannot reach C through B. Fix: peer directly, or use a transit hub.
  4. Peering overlapping CIDRs. Routes to an ambiguous destination cannot be resolved without translation or renumbering. Fix: plan non-overlapping blocks before connecting networks.
  5. Treating an endpoint policy as the whole authorization. The endpoint policy limits what can cross the endpoint, and the identity and resource policies still apply. Fix: check all three together when access is denied.

Interview tips

Open by naming the flow: source, destination, protocol, port, and direction. Then say which layer you check first. For a timeout, check name resolution, the forward route, both filters, the listener, and the return route, in that order.

Expect these follow-ups:

  • Why does the return traffic fail when the network ACL seems to allow it? (Ephemeral ports on a stateless rule.)
  • What if C needs to reach A through B? (Peering is not transitive. Use a transit hub.)
  • How do you avoid one NAT gateway becoming a zone-wide failure? (Deploy one per zone and route each zone to its own gateway.)
  • Why does the private DNS name resolve to the wrong address? (Check the zone association and the resolver path before touching routes.)

30-second outline: "I start from the flow and confirm the name resolves to the expected address. Then I check the forward route, the source and destination filters, and the listener. I check the return route and the ephemeral return path too, because a timeout is often a missing reply. Public reachability needs a route, a public address, and permitting filters together. I would also confirm failure domains per zone and that flow logs are on."

Feedback on this overview

Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.