Networking interview question · Most asked
What makes a subnet public or private in AWS?
Summary
Its route table: a public subnet's default route (0.0.0.0/0) points to an internet gateway, a private subnet's to a NAT gateway or nowhere. Resources in a public subnet also need a public IP to be reachable from the internet.
Longer Answer
Both use private address ranges; there's no 'public CIDR'. Azure has no public subnet concept: inbound comes via public load balancers or public IPs on resources, outbound via NAT gateway or default outbound access (being retired). In Google Cloud, VMs without external IPs use Cloud NAT.
Key Points
- The default route decides.
- Public IPs needed for inbound.
- Same private ranges for both.
- Azure/GCP model it differently.
Explanation
What interviewers look for
Precision about route tables rather than vague answers.
More most-asked Networking questions
- How does NAT work, and what are its limits?
- What's the difference between TCP and UDP, and when would you choose UDP?
- What do 502, 503 and 504 errors from a load balancer usually mean?
- What is CIDR notation? How many usable addresses are in a /26, and in an AWS /26 subnet?
- How does DNS resolution work, and what does a record's TTL control?
- What does TLS provide, and how does certificate validation work?
- What happens, at the network level, when you type a URL into a browser and press Enter?
- What's the difference between stateful and stateless firewalls? Give cloud examples.