1. Walk us through how you would design a multi-region disaster recovery strategy for a critical production application using AWS services.
I'd use Route 53 health checks with failover routing to direct traffic between primary and secondary regions, replicate data via RDS read replicas or DynamoDB global tables, and maintain pre-warmed infrastructure or use Auto Scaling groups with CloudFormation to spin up resources on failover. For example, at my previous role we configured RPO of 15 minutes and RTO of 5 minutes using Aurora cross-region replicas with automated failover.
2. Explain the difference between security groups and NACLs, and when you would use each in a production VPC design.
Security groups are stateful firewall rules applied at the instance level and are easier to manage, while NACLs are stateless subnet-level rules that evaluate all traffic bidirectionally. I'd use security groups for most application-level access control and NACLs as a secondary defense layer to block known malicious IPs or enforce strict deny rules at the subnet boundary.
3. You notice your RDS database is experiencing high CPU and slow query performance during peak hours. Walk through your troubleshooting approach.
I'd start by checking CloudWatch metrics for CPU, connections, and read/write IOPS, then enable Enhanced Monitoring to identify the specific processes consuming resources, query the Performance Insights dashboard to pinpoint slow queries, and check for missing indexes or inefficient query plans. If it's capacity-related, I'd consider vertical scaling (larger instance type) or read replicas; if query-related, I'd optimize the queries or add caching via ElastiCache.
4. What are the trade-offs between using EC2, ECS, and EKS for running containerized microservices at scale?
EC2 gives full control and flexibility but requires manual cluster management; ECS is simpler and AWS-native with less operational overhead but locked into AWS; EKS is portable across cloud providers and has a broader ecosystem, but adds complexity and cost with the managed control plane. For a startup, I'd choose ECS; for a multi-cloud strategy or complex workloads, EKS; for maximum customization, EC2.
5. How would you implement a least-privilege IAM policy for a developer who needs to deploy applications via CodePipeline?
I'd create a custom IAM policy that grants specific permissions: ec2:DescribeInstances, s3:GetObject for artifact bucket, iam:PassRole for the CodePipeline role, and cloudformation:CreateStack/UpdateStack/DeleteStack scoped to specific resource tags or CloudFormation stack prefixes. I'd avoid wildcards and use resource-based conditions like aws:RequestedRegion to further restrict access, then regularly audit with IAM Access Analyzer.
6. Describe how you would implement cost optimization across a multi-account AWS organization without sacrificing performance or security.
I'd use AWS Organizations with consolidated billing to identify spending patterns, implement Reserved Instances or Savings Plans for predictable workloads, right-size instances using Compute Optimizer, and use S3 Intelligent-Tiering for automatic storage cost optimization. I'd set up budgets and anomaly alerts in Cost Explorer, enforce tagging policies across accounts, and regularly review using the AWS Trusted Advisor cost optimization checks.
7. Explain how you would design a CI/CD pipeline in AWS that includes automated testing, security scanning, and canary deployments.
I'd use CodePipeline to orchestrate the workflow: CodeCommit/GitHub triggers CodeBuild for unit tests and SAST (SonarQube or CodeGuru), then CodeBuild runs container image scans with ECR image scanning, and finally CodeDeploy performs canary deployments using traffic shifting to gradually roll out to 10% of instances, monitoring CloudWatch metrics for errors before full rollout. If anomalies are detected, CodeDeploy automatically rolls back.
8. How would you migrate a monolithic on-premises application to AWS with minimal downtime?
I'd use AWS Database Migration Service (DMS) with change data capture to continuously replicate the database while the application still runs on-premises, deploy the application to EC2/ECS on AWS in parallel, use Route 53 weighted routing or DNS cutover to gradually shift traffic to AWS, and keep the on-premises system running as a fallback. The cutover typically happens during a maintenance window once validation is complete.
9. What monitoring and alerting strategy would you implement for a production Kubernetes cluster on EKS?
I'd deploy Prometheus for metrics collection and Grafana for dashboards, configure CloudWatch Container Insights for EKS-specific metrics (pod CPU/memory, node health), set up PagerDuty or SNS alerts for critical thresholds like node NotReady status or pod CrashLoopBackOff, and enable EKS control plane logging to CloudWatch Logs. I'd also use Falco for runtime security monitoring to detect anomalous workload behavior.
10. Design a secure, scalable architecture for a SaaS application serving thousands of customers with strict multi-tenancy isolation requirements.
I'd use separate VPCs or private subnets per customer for strong network isolation, implement row-level security in RDS via views and database roles, store customer encryption keys in AWS KMS with separate key policies per tenant, use S3 bucket policies with prefix-based access restrictions, and enforce isolation at the application layer via API Gateway resource policies. DynamoDB global secondary indexes with tenant ID as the partition key ensure data isolation and queryability.
11. Walk through how you would troubleshoot and optimize Lambda cold start performance for a latency-sensitive API endpoint.
I'd first measure baseline cold start time using X-Ray traces, then reduce package size by using Lambda layers and excluding unnecessary dependencies, choose a larger memory allocation (which increases CPU and reduces duration), use Provisioned Concurrency to keep warm instances running, or switch to ARM-based Graviton2 processors for better price-performance. For extreme latency sensitivity, I'd consider keeping a warm Lambda via EventBridge scheduled invocations or using ALB-backed EC2.
12. How would you implement compliance (e.g., HIPAA, PCI-DSS) across a multi-account AWS environment?
I'd enforce compliance through AWS Config rules and Security Hub to monitor non-compliant resources, use CloudTrail for audit logging in a centralized account, implement encryption in-transit (TLS) and at-rest (KMS) across all services, restrict access via IAM with MFA enforcement, and use AWS Artifact to generate compliance reports. I'd also enable VPC Flow Logs and configure GuardDuty for threat detection, then regularly audit with third-party assessors using AWS' compliance documentation.
