AWS VPC Interview Questions
Core Concepts
Q: Explain AWS VPC architecture.
A Virtual Private Cloud (VPC) is your private network in AWS — logically isolated from other AWS customers.
Key components:
Public vs Private subnet:
Public subnet = route table has route 0.0.0.0/0 → IGW (internet accessible)
Private subnet = route table has route 0.0.0.0/0 → NAT Gateway (outbound only)
Q: Security Groups vs Network ACLs — key differences?
| Security Group | NACL |
|---|
|---|---|---|
| Level | Instance (ENI) | Subnet |
|---|---|---|
| State | Stateful (return traffic auto-allowed) | Stateless (must allow both directions) |
| Rules | Allow only | Allow + Deny |
| Evaluation | All rules evaluated | Rules in order, first match wins |
| Default | Deny all in, allow all out | Allow all |
Best practice: Use Security Groups as primary firewall. Use NACLs for subnet-level blocking (e.g., block specific IPs).
Q: How does VPC peering work? What are its limitations?
VPC peering creates a private connection between two VPCs (same or different accounts/regions). Traffic stays on AWS backbone — not internet.
Limitations:
Transit Gateway: Hub-and-spoke model. One TGW connects many VPCs and on-premise networks. Transitive routing supported.
Q: Explain VPC endpoints — Interface vs Gateway.
VPC Endpoints allow private connectivity to AWS services without internet/NAT.
Gateway Endpoint: Free. Route table entry to S3 or DynamoDB only.
Interface Endpoint (PrivateLink): Paid. Creates ENI in your subnet with private IP. Works for 100+ AWS services (SQS, SSM, CloudWatch, etc.).
Use case: EC2 in private subnet needs to access S3 → use Gateway Endpoint (free, no NAT cost).
Q: Walk me through designing a 3-tier VPC.

