Hard👤 8-15 years 1 min read

How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?

Asked inAmazonMicrosoftDeloitte
#vpc peering#transit gateway#privatelink#direct connect#hybrid
Report issue

⚡ Short Answer

VPC Peering: 1:1 VPC connection (non-transitive — doesn't scale to many VPCs). Transit Gateway: a hub that routes between many VPCs + on-prem (the scalable choice). PrivateLink: expose/consume a specific service privately without exposing whole networks. Direct Connect/VPN link on-prem to AWS.

Coffee Chat Question

Concept Made Simple

How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?

🧠Mind Map Answer

Remember It Faster

Peering1:1, non-transitive, few VPCs
Transit Gatewayhub-and-spoke, many VPCs + on-prem
PrivateLinkprivate access to ONE service
Direct Connect/VPNon-prem ↔ AWS

🔥What If?

Think Beyond the Expected

You have 20 VPCs that all need to talk to each other — peering or Transit Gateway?

Transit Gateway. VPC peering is non-transitive, so 20 VPCs would need ~190 individual peering connections (n·(n-1)/2) — unmanageable. Transit Gateway acts as a central hub: each VPC attaches once and routes to the others, scaling cleanly.

😂Real World

Peering suits a couple of VPCs; at scale, Transit Gateway is the hub for many-VPC + hybrid connectivity, and PrivateLink exposes SaaS/internal services privately without broad network access.

🎯Interviewer's Expectation

Keywords they're listening for:

peering 1:1 non-transitiveTransit Gateway hub for scalePrivateLink per-serviceDirect Connect/VPN hybridmesh explosion problem

⚠️Common Mistakes

  • Full-mesh peering for many VPCs
  • Exposing whole VPCs when PrivateLink (one service) fits
  • Assuming peering is transitive

Best Practices

  • Transit Gateway for many-VPC/hybrid
  • PrivateLink for private per-service access
  • Peering only for a small number of VPCs

🔁Follow-up Questions

  • 1Why is VPC peering non-transitive a problem at scale?
  • 2PrivateLink vs peering for exposing a service?
  • 3Direct Connect vs VPN trade-offs?

🧩Related Technologies

Transit GatewayPrivateLinkDirect ConnectVPN

Continue Learning with AI

Take this question deeper with your favourite AI assistant. Pick a depth, copy the prompt, or open it directly — AI is your learning companion, not a shortcut.

Plain-language foundations

I'm preparing for a software engineering interview and want to understand this from scratch, as a beginner.

Topic: VPC (AWS)
Interview question: "How do you connect VPCs and on-prem networks — peering, Transit Gateway, PrivateLink?"

Please:
1. Explain the core idea in simple, plain language, using an everyday analogy.
2. Define any technical terms you use.
3. Walk through one small, concrete example.
4. Finish with a single sentence I can easily remember.

Keep the tone friendly and assume I'm new to this topic.
Open inChatGPTGeminiClaude

Was this answer helpful?

Support our platform by exploring our recommended products.

As an Amazon affiliate, purchases through these links may earn us a small commission — at no extra cost to you. It helps keep Full Stack Interview Guru free.

Related Questions