Interview questions and model answers
"Design a VPC for an EKS-based production workload."
Three AZs, a /16 with public subnets for ALBs and NAT gateways (one NAT per AZ), large private subnets for nodes and pods because the VPC CNI uses VPC IPs (or prefix delegation/secondary CIDRs), and isolated data subnets for RDS and ElastiCache with no internet route. Gateway endpoints for S3 and DynamoDB, interface endpoints for ECR, STS, CloudWatch Logs and Secrets Manager to keep traffic private and cut NAT costs. Security groups referencing each other, Flow Logs on, CIDRs allocated centrally so we can attach to a Transit Gateway later.
"Security group vs NACL?"
Security groups are stateful, attached to ENIs, allow-only, and can reference other security groups — they're the primary control. NACLs are stateless subnet-level rules with allow and deny evaluated in order, so you must allow return ephemeral ports. I use NACLs only as coarse guardrails or to block specific ranges.
"An EC2 instance in a private subnet can't reach the internet. Debug."
Check the subnet's route table has 0.0.0.0/0 to a NAT gateway; for a zonal NAT gateway, that it sits in a public subnet whose route table points to an IGW, that it has an Elastic IP and is available, then security group outbound rules, NACLs in both directions including ephemeral ports, and DNS resolution. Reachability Analyzer and Flow Logs confirm where it's dropped.
"Multi-AZ vs read replica in RDS?"
Multi-AZ keeps a synchronous standby in another AZ for automatic failover — availability, not read scaling. Read replicas are asynchronous copies for scaling reads, can be cross-region and can be promoted for DR. Aurora combines both: replicas serve reads and are failover targets.
"ALB returns 502s intermittently during deployments."
Usually targets closing connections: pods terminated before the ALB deregisters them, or the app's keep-alive timeout shorter than the ALB idle timeout. Fix with a preStop sleep longer than deregistration propagation, tuned deregistration delay, readiness gates with the Load Balancer Controller, and app keep-alive longer than 60 s.
"How do you safely update a CloudFormation stack that contains a production database?"
Create a change set and review it for replacements; have DeletionPolicy and UpdateReplacePolicy set to Snapshot or Retain on the database, termination protection and a stack policy denying replacement of the DB; deploy through the pipeline with approval; watch events and have rollback triggers on alarms.
"Our AWS bill jumped 40%. Where do you start?"
Cost Explorer grouped by service, then by usage type and tags to find the driver — often NAT gateway data processing, cross-AZ transfer, new instances or log ingestion. Then targeted fixes: VPC endpoints, rightsizing, Spot and Savings Plans, lifecycle policies, log retention, and turning off idle non-prod. Put budgets and anomaly detection in place so we catch it earlier.
"Explain RTO and RPO and pick a DR strategy for a payments API."
RTO is the time to restore service, RPO the acceptable data loss. Payments usually need minutes of RTO and near-zero RPO, so warm standby or active/active: Aurora Global Database or DynamoDB global tables, infrastructure defined in IaC and running at reduced scale in the second region, Route 53 health-checked failover, and regular failover drills.