What is a VPC, and what is a subnet within it? Why split a network into subnets at all?
What they are really testing: They want to see if you can reason about network isolation rather than recite an acronym. The subtext is the public versus private split that protects backend resources.
A real interview question
What is a VPC, and what is a subnet within it? Why split a network into subnets at all?
What most people say
drag me
“A VPC is your network in the cloud and a subnet is a smaller network inside it.”
It is technically not wrong but stops at definitions. It never explains the public versus private split, which is the whole point of subnetting in practice.
The follow-ups they ask next
How does a resource in a private subnet reach the internet for updates if it needs to?
Describe outbound-only access through a NAT gateway, which lets the resource initiate connections out without allowing inbound from the internet.
Why spread subnets across multiple availability zones?
Tie it to resilience: if one zone fails, resources in subnets in another zone keep serving.
What the interviewer is listening for
- frame the VPC as an isolated network
- explain public versus private subnets
- place databases in private subnets
- mention firewall rules enforce isolation
What sinks the answer
- stop at bare definitions
- put a database in a public subnet
- confuse a VPC with a single subnet
- assume isolation needs no rules
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“A VPC is [my own isolated private network in the cloud with an IP range I control], and a subnet is [a slice of that range where I place resources]. I split into subnets so I can keep [internet-facing things like web servers] in a public subnet and [backend things like databases] in a private subnet that cannot be reached directly from the internet.”
Keep going with networking
Foundation
What is the difference between TCP and UDP, and when would you choose each?
Foundation
What happens, step by step, when you type a URL into a browser and press enter?
Foundation
How does DNS resolution actually work, and what is the difference between an A record and a CNAME?
Foundation
What is the difference between IPv4 and IPv6, and why does IPv6 exist?
Junior
An EC2 instance in a private subnet needs to download OS updates from the internet. Walk me through how you make that work, and why.
Junior
In AWS, what is the difference between a security group and a network ACL, and when would you reach for each?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free