AWS Networking Interview Questions and Answers: Route 53, CloudFront, Transit Gateway, Direct Connect and VPN (50 Questions)
This page has 50 new networking interview questions with full answers. The first set covered VPC basics. This page goes further: DNS in depth, content delivery, hybrid links to offices and data centres, and connecting many VPCs and accounts.
1. An everyday example: a city's roads and post office
Why do networking questions decide so many interviews?
Almost every outage story includes a network part: a DNS record, a route, a certificate, a tunnel or a firewall rule. Network engineers, cloud engineers and SREs are expected to find these quickly, and to design networks that do not break when one link fails.
Think of a large city. Route 53 is the post office directory that turns names into addresses. CloudFront is a chain of local warehouses that keeps popular goods close to customers. Transit Gateway is the central bus station that connects every neighbourhood. Direct Connect is a private highway to your factory outside the city, and Site-to-Site VPN is an armoured van on public roads.
How to use this page
- Draw each design on paper as you read the answer.
- For DNS and CloudFront questions, try the commands against your own test domain.
- For hybrid questions, always talk about redundancy: two of everything.
2. Fresher level questions
Start here if you are a fresher or have less than two years of experience. Try to answer each question aloud first. Then open it and compare.
Q1. What is the difference between a public hosted zone and a private hosted zone in Route 53? Fresher
- Public hosted zone: answers DNS queries from the internet for a domain you own, such as example.com.
- Private hosted zone: answers only for queries coming from the VPCs you associate with it, such as internal.example.com for internal services.
Everyday example: a public phone directory versus the internal phone list inside an office.
You can have both for the same name (split-horizon DNS). Then app.example.com returns a public ALB to internet users and a private IP to servers inside the VPC.
Private hosted zones need enableDnsHostnames and enableDnsSupport turned on in the VPC.
Q2. What do the NS and SOA records in a hosted zone do? Fresher
When you create a hosted zone, Route 53 adds two records:
- NS (name server) record: lists the four Route 53 name servers for the zone. You copy these to your domain registrar, so the internet knows where to ask.
- SOA (start of authority) record: basic information about the zone, including the negative caching time for names that do not exist.
If the registrar still lists old name servers, your new records in Route 53 are never used. This is a common reason for "I created the record but it does not work".
Q3. What does the TTL of a DNS record control? Fresher
TTL (time to live) is how many seconds resolvers and clients may cache the answer.
- A long TTL, such as 86400 (one day), means fewer DNS queries and lower cost, but changes take a long time to reach everyone.
- A short TTL, such as 60 seconds, means changes spread fast, which is useful before a migration or for failover.
Tip: lower the TTL a day before a planned change, make the change, then raise it again later.
Alias records to AWS resources use the TTL of the target resource, so you do not set it yourself.
Q4. What is the difference between geolocation and geoproximity routing in Route 53? Fresher
- Geolocation routing: chooses the answer based on where the user is, by continent, country or US state. Example: users in India get the Mumbai endpoint, users in Germany get the Frankfurt endpoint. Add a default record for locations you did not list.
- Geoproximity routing: chooses based on distance between users and your resources, and you can use a bias to make one Region attract more or fewer users.
Use geolocation for legal or language reasons, and geoproximity to balance traffic by distance.
Q5. What is a multivalue answer record in Route 53? Fresher
Multivalue answer routing returns up to eight healthy IP addresses for one name, chosen at random.
You can attach a health check to each value, so unhealthy addresses are not returned.
It is a simple way to spread traffic across several servers without a load balancer, with some fault tolerance.
It is not a full load balancer: clients cache DNS and may keep using a failed IP until the TTL expires.
Q6. What does the viewer protocol policy setting in a CloudFront behaviour do? Fresher
It decides how CloudFront handles HTTP and HTTPS requests from users (viewers):
- HTTP and HTTPS: both are allowed.
- Redirect HTTP to HTTPS: users on HTTP get a 301 redirect to the HTTPS URL. This is the usual choice for websites.
- HTTPS only: HTTP requests are rejected with 403.
A separate setting, the origin protocol policy, decides whether CloudFront talks to your origin over HTTP or HTTPS.
For full encryption, use HTTPS between users and CloudFront and also between CloudFront and the origin.
Q7. What is the difference between a CloudFront distribution's origin and its behaviour? Fresher
- An origin is where CloudFront fetches content: an S3 bucket, an ALB, an API Gateway, a MediaPackage endpoint or any HTTP server.
- A behaviour (cache behaviour) is a rule that matches a path pattern, such as /api/* or /images/*, and says which origin to use and how to cache, compress and secure it.
Example: /images/* goes to S3 and is cached for a day. /api/* goes to the ALB with caching turned off. The default behaviour (*) serves everything else.
Q8. What is a CloudFront price class? Fresher
A price class limits which edge locations CloudFront uses.
- Price Class All: all edge locations, best performance worldwide.
- Price Class 200 and Price Class 100: fewer regions, excluding some of the more expensive locations.
Users in excluded regions are still served, but from a farther location, so latency may be higher.
Use a cheaper price class when your users are mostly in North America and Europe, and choose All if you have many users in South America, Australia or parts of Asia.
Q9. What is AWS Direct Connect in simple words? Fresher
Direct Connect is a private network connection between your data centre or office and AWS. It does not use the public internet.
You connect at a Direct Connect location (a data centre where AWS has equipment), often through a partner telecom company.
Benefits: more consistent latency, high bandwidth (from small hosted connections to 100 Gbps or more on dedicated ports), and often lower data transfer out cost than the internet.
It takes weeks to set up, so companies often start with a VPN first.
Q10. What are the parts of an AWS Site-to-Site VPN connection? Fresher
- Customer gateway: a resource in AWS that describes your on-premises VPN device (its public IP and, for dynamic routing, its BGP ASN).
- Virtual private gateway or Transit Gateway: the AWS side of the VPN.
- VPN connection: links the two, with two IPsec tunnels to two different AWS endpoints for redundancy.
- Routing: static routes, or dynamic routing with BGP.
Both tunnels should be configured on your device. AWS does maintenance on one tunnel at a time, so a single-tunnel setup will have outages.
Q11. What is Amazon VPC IP Address Manager (IPAM) used for? Fresher
IPAM helps you plan, track and monitor IP addresses across many accounts and Regions.
- You create pools, for example 10.0.0.0/8 for the company, then smaller pools per Region and per environment.
- New VPCs take their CIDR from a pool, so ranges never overlap.
- IPAM shows which addresses are used, and alerts on overlapping or non-compliant ranges.
It also manages public IPv4 addresses and helps you see public IP usage, which matters because AWS charges for public IPv4 addresses.
Everyday example: a land registry office that makes sure no two houses get the same plot.
Q12. What is the difference between a VPC endpoint (PrivateLink) for an AWS service and an endpoint service for your own app? Fresher
- Interface endpoint for an AWS service: lets your VPC reach services like SQS or Secrets Manager through private IPs in your subnets.
- Endpoint service (your own PrivateLink service): you publish your application behind a Network Load Balancer (or Gateway Load Balancer). Other VPCs and accounts create interface endpoints to reach it privately.
Example: a payments team publishes its API as an endpoint service. Other teams connect without VPC peering, and only the API port is exposed, not the whole network.
Q13. What is a dual-stack VPC? Fresher
A dual-stack VPC has both IPv4 and IPv6 CIDR blocks. Subnets get IPv6 ranges (/64), and instances can have both an IPv4 and an IPv6 address.
Why: IPv6 addresses are plentiful, and AWS charges for public IPv4 addresses, so IPv6 can reduce cost and address pressure.
Remember:
- IPv6 addresses from AWS are globally unique and public by nature. Security groups and routes decide reachability.
- For outbound-only IPv6 internet access, use an egress-only internet gateway.
Q14. What does Route 53 health checking do for an endpoint? Fresher
A Route 53 health check sends requests (HTTP, HTTPS or TCP) to your endpoint from health checkers in several locations.
If enough checkers see failures, the endpoint is marked unhealthy. Routing policies such as failover, latency or weighted then stop returning that endpoint.
You can also create:
- Calculated health checks that combine other checks.
- Health checks based on a CloudWatch alarm, which is useful for private resources that health checkers cannot reach.
You can alarm on health check status with CloudWatch.
Q15. How do you look up DNS records for a domain from the command line? Fresher
dig +noall +answer shop.example.com AOutput:
shop.example.com. 60 IN A 203.0.113.40
shop.example.com. 60 IN A 203.0.113.41The name returns two IPv4 addresses with a 60-second TTL. They are likely ALB or Global Accelerator addresses.
Useful variations:
dig NS example.comshows which name servers are responsible.dig @ns-123.awsdns-15.com shop.example.comasks a Route 53 name server directly, skipping caches.dig +tracefollows the delegation from the root.
Q16. What is Gateway Load Balancer used for? Fresher
Gateway Load Balancer (GWLB) helps you deploy, scale and run third-party virtual network appliances, such as firewalls and intrusion detection systems.
It sends traffic to a fleet of appliances and keeps flows sticky to one appliance, using GENEVE encapsulation.
Other VPCs send traffic to it through Gateway Load Balancer endpoints, which you add as targets in route tables.
Example: all internet traffic from spoke VPCs passes through a fleet of firewall appliances in an inspection VPC before leaving.
Q17. What is the difference between AWS Network Firewall and security groups? Fresher
- Security groups: stateful, per network interface, allow rules only, based on IPs, ports and other security groups.
- AWS Network Firewall: a managed, stateful firewall for whole VPC traffic flows. It supports allow and deny rules, domain name filtering, and Suricata-compatible intrusion prevention rules.
You place Network Firewall endpoints in dedicated subnets and change route tables to send traffic through them.
Use security groups for every resource, and Network Firewall for central inspection and egress filtering.
3. Mid level questions
These questions check how you use the service in real projects. Interviewers expect the why, the how and one real example.
Q18. How do CloudFront cache policies and origin request policies differ? Mid level
- Cache policy: decides the cache key (which headers, cookies and query strings make an object unique) and the TTLs. Everything in the cache key is also sent to the origin.
- Origin request policy: decides extra values sent to the origin that are not part of the cache key.
Example: your API needs the User-Agent header, but caching per User-Agent would destroy your cache hit ratio. Put User-Agent in the origin request policy, not in the cache policy.
Rule: keep the cache key as small as possible.
Q19. Your CloudFront cache hit ratio is only 20%. How do you improve it? Mid level
- Check the cache key: are you including all cookies, all query strings or headers like Authorization or User-Agent? Each unique value creates a separate cached copy.
- Check origin Cache-Control headers: the origin may send no-cache or max-age=0.
- Normalise requests, for example sort or remove unneeded query strings with a CloudFront Function.
- Separate static and dynamic paths into different behaviours.
- Turn on Origin Shield for a central caching layer if you have users in many regions.
Measure with the CloudFront cache statistics report and standard logs (x-edge-result-type Hit or Miss).
Q20. When would you use CloudFront Functions instead of Lambda@Edge? Mid level
CloudFront Functions:
- JavaScript, very short and lightweight, run at edge locations.
- Only on viewer request and viewer response events.
- Very low cost and sub-millisecond execution.
- Uses: URL rewrites, redirects, header changes, simple token checks, cache key normalisation.
Lambda@Edge:
- Node.js or Python, more time and memory, network access.
- Runs on viewer and origin events.
- Uses: calling external services, complex authentication, generating responses, changing origin requests.
Start with CloudFront Functions and move to Lambda@Edge only when you need its extra power.
Q21. What are CloudFront VPC origins? Mid level
VPC origins let CloudFront reach an Application Load Balancer, Network Load Balancer or EC2 instance in a private subnet directly, without making that origin public.
Before this feature, the ALB usually had to be internet-facing, and you protected it with a secret header or security group prefix lists for CloudFront.
With a VPC origin, the origin has no public exposure, so all users must come through CloudFront, where you apply WAF rules and caching.
Check Region and resource support in the current documentation before you design with it.
Q22. How does CloudFront origin failover work? Mid level
You create an origin group with a primary and a secondary origin, and choose which HTTP status codes trigger failover, such as 500, 502, 503 and 504.
If the primary returns one of these codes or does not respond in time, CloudFront retries the request on the secondary origin.
Example: the primary is an S3 bucket in Mumbai, the secondary is a replicated bucket in Singapore.
Note: origin failover works for GET, HEAD and OPTIONS requests. For writes, design failover at the application or DNS level.
Q23. What is Origin Shield in CloudFront? Mid level
Origin Shield is an extra caching layer in one chosen AWS Region in front of your origin.
All regional edge caches go through Origin Shield, so a popular object is fetched from your origin only once, instead of once per region.
Benefits: a higher cache hit ratio, less load on the origin, and lower origin costs, which is useful for live video or origins that are expensive to call.
Choose the Origin Shield Region closest to your origin. It has an extra charge per request.
Q24. How do Transit Gateway route table associations and propagations work? Mid level
- Association: each attachment is associated with exactly one TGW route table. When traffic arrives from that attachment, TGW looks up the destination in that table.
- Propagation: an attachment can propagate its routes (its VPC CIDR, or BGP routes from VPN or Direct Connect) into one or more route tables automatically.
- You can also add static routes, including blackhole routes to drop traffic.
Example: dev VPCs associate with the dev table and propagate only to the dev and shared tables, so dev can reach shared services but never prod.
Q25. How do you isolate production and development VPCs on one Transit Gateway? Mid level
Use several TGW route tables.
- Prod route table: associated with prod VPC attachments. Contains routes to prod VPCs, shared services and on-premises.
- Dev route table: associated with dev VPCs. Contains routes to dev VPCs and shared services only.
- Shared services table: associated with the shared VPC. Contains routes to both prod and dev.
Turn off default route table association and propagation, so new attachments do not join everything automatically.
Remember that VPC route tables also need routes pointing to the Transit Gateway.
Q26. What are the three types of Direct Connect virtual interfaces? Mid level
- Private VIF: reaches private IP addresses in one VPC (through a virtual private gateway) or in many VPCs through a Direct Connect gateway.
- Public VIF: reaches AWS public service endpoints, such as S3 public endpoints, over Direct Connect instead of the internet. You need public IPs.
- Transit VIF: connects to a Direct Connect gateway associated with Transit Gateways, so you reach many VPCs through TGW.
Each VIF has its own VLAN and BGP session.
Q27. What is a Direct Connect gateway? Mid level
A Direct Connect gateway is a global resource that connects your Direct Connect virtual interfaces to virtual private gateways or Transit Gateways in many Regions.
Example: one connection in Mumbai, through a Direct Connect gateway, reaches VPCs in Mumbai and Singapore.
It does not route traffic between the VPCs themselves, and it does not route between two on-premises sites unless you use a feature such as SiteLink.
It also simplifies adding new Regions: you associate a new gateway instead of building a new connection.
Q28. How do you make Direct Connect highly available? Mid level
AWS describes resiliency models:
- Development and test: one connection at one location (no redundancy).
- High resiliency: connections at two different Direct Connect locations.
- Maximum resiliency: two connections at each of two locations, on separate devices.
Also:
- Use a Site-to-Site VPN as a lower-cost backup path.
- Use BGP so traffic fails over automatically.
- Test failover by shutting down one BGP session in a maintenance window.
The Direct Connect Resiliency Toolkit in the console helps you order the right setup.
Q29. How do you prefer Direct Connect over VPN when both advertise the same routes? Mid level
AWS chooses routes in this general order: longest prefix match first. For the same prefix, static routes and Direct Connect BGP routes are preferred over Site-to-Site VPN routes, based on AWS route priority rules.
From your on-premises side:
- Use BGP local preference to prefer the Direct Connect path for outbound traffic.
- Use AS path prepending on the VPN advertisement to make it less attractive for traffic coming back.
Check the current route priority rules in the documentation, because they differ between virtual private gateways and Transit Gateways.
Q30. What is the bandwidth of a Site-to-Site VPN tunnel and how do you get more? Mid level
For a long time, each VPN tunnel supported up to about 1.25 Gbps. AWS has since added options for larger-bandwidth tunnels, so check the current documentation for the exact numbers.
Ways to get more total bandwidth:
- Terminate VPNs on a Transit Gateway and use ECMP (equal-cost multi-path) across several VPN connections with BGP.
- Use Direct Connect for high, steady bandwidth.
- Accelerated Site-to-Site VPN uses Global Accelerator to improve performance over long distances. It requires a Transit Gateway attachment.
Q31. How do you troubleshoot a Site-to-Site VPN tunnel that is DOWN? Mid level
- Check tunnel status and status message in the console or CLI.
- Phase 1 (IKE) problems: wrong pre-shared key, wrong IKE version, mismatched encryption settings, or the customer device's public IP does not match the customer gateway.
- Phase 2 (IPsec) problems: mismatched encryption domains or proposals.
- Firewalls: UDP 500 and 4500 must be allowed, and NAT devices must support NAT traversal.
- BGP: if the tunnel is UP but routes are missing, check BGP neighbours and advertised prefixes.
Turn on VPN tunnel logs to CloudWatch Logs to see IKE negotiation errors.
Q32. What is Route 53 Resolver DNS Firewall? Mid level
DNS Firewall filters DNS queries that resources in your VPC send through the Route 53 Resolver.
You create domain lists (your own or AWS managed lists of known malicious domains) and rules to allow, block or alert.
Example: block queries to known malware domains, and allow only a list of approved domains for a sensitive VPC.
It helps stop data exfiltration through DNS and calls to command-and-control servers. Manage it across accounts with AWS Firewall Manager.
Q33. Why would you turn on DNSSEC signing in Route 53? Mid level
DNSSEC adds cryptographic signatures to DNS answers, so resolvers can check that answers really come from the domain owner and were not changed (DNS spoofing).
In Route 53:
- Turn on DNSSEC signing for a public hosted zone. Route 53 uses a key-signing key backed by a customer managed KMS key in us-east-1.
- Add the DS record at the parent zone (through your registrar), to build the chain of trust.
Risk: mistakes, such as deleting the KMS key, can make your domain fail to resolve for validating resolvers. Monitor it with CloudWatch alarms.
Q34. How do you share one private hosted zone with VPCs in other AWS accounts? Mid level
A private hosted zone can be associated with VPCs in other accounts:
- In the zone owner's account, create a VPC association authorisation for the other account's VPC.
- In the other account, associate the VPC with the hosted zone.
- Then delete the authorisation (the association stays).
Another common design: use Route 53 Resolver rules shared through AWS RAM, so many VPCs forward queries for internal domains to a central DNS setup.
Interview tip: mention that this is how central "internal.example.com" names work across a multi-account organisation.
Q47. How do you log every DNS query made from a VPC? Mid level
Turn on Route 53 Resolver query logging.
- Create a query logging configuration with a destination: CloudWatch Logs, S3 or Amazon Data Firehose.
- Associate it with the VPCs you want to log. You can share the configuration across accounts with AWS RAM.
Each log line includes the query name, type, response code, the source IP and the instance ID.
Uses: find which server is calling a suspicious domain, find services that still call old endpoints, and troubleshoot NXDOMAIN errors.
Public hosted zone query logging is a separate feature that logs queries reaching Route 53 from the internet.
4. Senior level and scenario questions
These questions check design thinking and troubleshooting. Think aloud. Say what you check first, what you change, and how you prevent it next time.
Q35. Design hybrid connectivity for a bank with two data centres and 40 VPCs in two Regions. Senior
- Two Direct Connect locations, with connections from each data centre (maximum resiliency for critical traffic), MACsec where supported.
- Transit VIFs to a Direct Connect gateway, associated with a Transit Gateway in each Region.
- Site-to-Site VPN on each Transit Gateway as a backup path.
- Transit Gateway route tables to separate prod, non-prod and shared services, plus inter-Region TGW peering.
- A central inspection VPC with Network Firewall or appliances behind Gateway Load Balancer, with appliance mode turned on for the inspection attachment.
- Central DNS with Route 53 Resolver endpoints and shared rules.
- IP plan from IPAM to avoid overlaps.
Q36. Why must you turn on appliance mode on a Transit Gateway attachment for an inspection VPC? Senior
A Transit Gateway normally keeps traffic in the same Availability Zone where it entered when possible. For a stateful firewall in an inspection VPC, the request and the reply could then go through firewall endpoints in different AZs.
The second firewall has not seen the start of the connection, so it drops the reply. This causes random connection failures.
Appliance mode makes the Transit Gateway pick one network interface in the appliance VPC for the whole flow (both directions), using a flow hash, so stateful inspection works.
Turn it on for the inspection VPC attachment.
Q37. Users in one country cannot reach your site, but everyone else can. What do you check? Senior
- DNS: are geolocation records missing a default, so users in that country get no answer? Test with a resolver in that country, or use a VPN to that location.
- CloudFront geo restriction or a WAF geo-match rule blocking the country by mistake.
- Route 53 health checks marking that region's endpoint unhealthy, with no fallback.
- Local ISP or government blocking of your IP addresses or domain.
- TLS problems with older devices common in that market.
Use CloudFront logs and WAF logs filtered by country to see whether requests arrive at all.
Q38. How would you migrate a busy website to a new CloudFront distribution without downtime? Senior
- Create the new distribution with the same behaviours, certificates and WAF rules. Test it using its cloudfront.net name and a hosts-file override.
- An alternate domain name (CNAME) can normally be attached to only one distribution. Use the supported domain move process, for example a staging distribution or the alias move feature, instead of deleting the old one first.
- Lower the DNS TTL in advance, then switch the Route 53 alias to the new distribution.
- Watch error rates and cache hit ratio on both distributions.
- Keep the old one for rollback until traffic has fully moved.
CloudFront continuous deployment with a staging distribution lets you test changes on a small share of real traffic first.
Q39. Two Transit Gateways in different Regions are peered, but traffic does not flow. What do you check? Senior
- Peering attachment state is available and accepted.
- Static routes: TGW peering does not propagate routes. You must add static routes in each TGW route table pointing to the peering attachment for the other Region's CIDRs.
- The peering attachment is associated with a route table that has routes back to the local VPCs.
- VPC route tables in both Regions point the remote CIDRs to the Transit Gateway.
- Security groups and NACLs allow the remote CIDRs.
- No overlapping CIDRs between Regions.
Use Reachability Analyzer and Transit Gateway Network Manager route analysis to find the missing hop.
Q40. How do you design DNS failover for an application with a primary and a DR Region? Senior
- Route 53 failover routing: primary record with a health check on the primary Region's endpoint, secondary record for the DR Region.
- Health check something meaningful, such as a deep health endpoint, or a calculated health check, and avoid flapping by tuning thresholds.
- Keep TTLs short, such as 60 seconds.
- Make sure the DR Region is ready: data replicated, capacity warm or scaled, secrets and config present.
- For controlled, manual switchovers, use Route 53 Application Recovery Controller routing controls, which work even during control plane problems.
- Test failover and failback regularly.
Q41. A partner must call your private API from their AWS account, but both use 10.0.0.0/16. How do you connect them? Senior
Overlapping CIDRs rule out VPC peering and simple Transit Gateway routing.
Best option: AWS PrivateLink. Put your API behind a Network Load Balancer, create an endpoint service, and allow the partner's account. The partner creates an interface endpoint in their VPC. They reach your API through IPs in their own subnets, so overlapping ranges do not matter.
Extra controls: require acceptance of endpoint connections, use private DNS for the endpoint service (after domain verification), and add authentication on the API itself.
Q42. How do you control and monitor all outbound internet traffic from 30 VPCs? Senior
- Centralised egress: spoke VPCs have no internet gateways or NAT gateways. Their default route goes to a Transit Gateway.
- An egress VPC with NAT gateways in each AZ and AWS Network Firewall (or appliances behind GWLB) in front of them.
- Domain allow lists in Network Firewall, and Route 53 Resolver DNS Firewall for DNS.
- VPC Flow Logs and firewall logs into a central log account.
- SCPs to stop teams from creating their own internet gateways.
Trade-offs: extra TGW and firewall processing cost, and a central component that must be highly available across AZs.
Q43. Latency to AWS from your office jumped from 8 ms to 40 ms although Direct Connect is up. What happened? Senior
Traffic is probably taking another path.
- Check BGP: did the Direct Connect BGP session flap, or did on-premises routers start preferring the VPN or internet path? Look at routing tables and BGP route preferences.
- Did someone advertise a more specific prefix over the VPN, which wins over the Direct Connect route (longest prefix match)?
- Check the Direct Connect connection metrics: ConnectionState, BGP status and errors.
- Traceroute from both sides to see the real path.
Fix the route preferences and add monitoring and alarms on BGP status and latency.
Q44. How do you plan IPv6 adoption for an existing AWS workload? Senior
- Add IPv6 CIDRs to VPCs and subnets, and update route tables (internet gateway for public, egress-only internet gateway for private).
- Update security groups and NACLs with IPv6 rules. IPv4 rules do not cover IPv6.
- Make load balancers dual-stack and add AAAA alias records.
- Check that applications, logs and allow lists handle IPv6 addresses.
- For IPv6-only workloads that must call IPv4 services, use DNS64 and NAT64 on the NAT gateway.
- Roll out gradually, starting with front ends, and monitor errors by protocol.
Benefit: fewer public IPv4 charges and no address shortage.
Q45. A company wants many teams to share internal services without managing peering, Transit Gateway routes or overlapping IPs. What do you suggest? Senior
Consider Amazon VPC Lattice.
- Each team registers its service (backed by instances, containers, Lambda or an ALB) in a service network.
- VPCs and accounts are associated with the service network through AWS RAM.
- Lattice handles service-to-service connectivity at the application layer, with IAM-based auth policies and access logs.
- It works across accounts and with overlapping CIDRs.
Compare with PrivateLink, which is better for exposing one service to many consumers, and Transit Gateway, which gives full network connectivity. Many companies use a mix.
Q46. Users report that a site behind CloudFront sometimes shows another user's personal data. What could cause it? Senior
This is a serious caching bug: personalised responses were cached and served to other users.
Check:
- The cache behaviour for pages like /account: caching should be off, or the cache key must include the session cookie or Authorization header.
- The origin's Cache-Control: personal responses should send private or no-store.
- A recent change to cache policies or TTLs.
Immediate action: disable caching for the affected paths, invalidate them, and treat it as a data privacy incident (inform security, check logs for impact).
Prevention: separate behaviours for public and personal content, and test caching rules in staging with two different users.
Q48. How do you stop users from bypassing CloudFront and calling your ALB origin directly? Senior
If the ALB is public, anyone who learns its DNS name can skip your CloudFront WAF rules and caching.
Options:
- Best: use CloudFront VPC origins, so the ALB is internal with no public access at all.
- Allow only CloudFront in the ALB security group using the AWS managed prefix list for CloudFront origin-facing addresses.
- Add a secret custom header in CloudFront and an ALB listener rule that returns 403 when the header is missing. Rotate the secret.
- Also attach WAF to the ALB for defence in depth.
Combine the prefix list and the header, because the prefix list alone allows other people's CloudFront distributions.
Q49. Your Transit Gateway data processing charges doubled this month. How do you find the cause? Senior
Transit Gateway charges per attachment hour and per GB processed.
- Use Cost Explorer by usage type and resource to find which Transit Gateway and which Region.
- Turn on Transit Gateway Flow Logs (or use VPC Flow Logs) and group bytes by source and destination attachment and IP.
- Common causes: a new backup or replication job sending data between VPCs, chatty services split across VPCs, or traffic to S3 going through a central egress path instead of a local gateway endpoint.
Fixes: add S3 and DynamoDB gateway endpoints in each VPC, keep chatty services together, and schedule large transfers wisely.
Q50. A record in a private hosted zone does not resolve from an EC2 instance. How do you troubleshoot? Senior
- Is the instance's VPC associated with the private hosted zone? This is the most common cause.
- Are enableDnsSupport and enableDnsHostnames turned on for the VPC?
- Is the instance using the VPC resolver (VPC base plus 2), or a custom DNS server in resolv.conf or DHCP options that does not know the zone?
- Is there an overlapping zone? For example, a private zone for example.com and another for app.example.com: the most specific zone wins, and a missing record there returns NXDOMAIN.
- Is a Resolver forwarding rule sending that domain to on-premises DNS instead?
Test with dig @169.254.169.253 name from the instance.
5. Frequently asked questions
Do cloud engineers need BGP knowledge?
Yes, at a basic level. Direct Connect and dynamic VPN use BGP. Know what an ASN is, what prefixes are advertised, and how AS path and local preference change the chosen path.
Is Transit Gateway always better than peering?
No. Peering is simpler and has no hourly attachment or data processing charge, so it is good for a few VPCs. Transit Gateway is better for many VPCs, central inspection, and connecting on-premises networks once.
Which numbers should I remember?
Remember ideas more than numbers. For limits such as VPN tunnel bandwidth, say "at the time of writing" and mention that AWS updates them.
6. Quick revision
- Private hosted zones answer only inside associated VPCs.
- The cache key decides what CloudFront treats as the same object.
- Transit Gateway: associations decide which route table an attachment uses, propagations decide which routes appear in it.
- Direct Connect VIFs: private (VPC), public (AWS public services), transit (Transit Gateway).
- Each Site-to-Site VPN connection has two tunnels. Use both.
7. Related chapters
- AWS VPC and Networking Interview Questions and Answers (50 Questions with Scenarios)
- AWS Transit Gateway and PrivateLink: Connect VPCs and Services Explained
- ALB vs NLB vs Gateway Load Balancer in AWS
- CloudFront Cache Behaviors, TTL and Invalidation Step by Step
- AWS Cloud Firewalls: Network Firewall, DNS Firewall, Firewall Manager and WAF
- AWS CLI Route 53 Commands: Hosted Zones and DNS Records
This page is one part of a 1000-question AWS interview set. Open the full list here: All 1000 AWS interview questions.