DevOps Interview Questions with AWS for Cognizant

  1. Explain how Linux mechanisms work, especially when the system starts.
  2. What happens when you run a container in Kubernetes? Explain the internal workings.
  3. What is the difference between git merge and git rebase?
  4. Why and when would you use the git cherry-pick command?
  5. Key differences between Jenkins Declarative Pipeline and Scripted Pipeline?
  6. What is DNS and how does it work?
  7. Explain how routes work in a network environment.
  8. How do you implement network policies in Kubernetes?
  9. How do Prometheus and Grafana interact? What is the source of data for Prometheus?

10.Which database did you use in your recent project, and why? What is an SQL index, and how does it work?

  1. Can you share a situation where you faced a challenge working with a non-technical team, and how you solved it?
  2. .Would you describe yourself as a communicator or a problem-solver?
  1. Tell me about a situation where you took on a leadership role.
  2. What values do you consider important when working with a team?
  3. What are your hobbies outside of technical work?
  4. Why did you choose Docker in your recent project?
  5. Auto Scaling Scenario-Based Interview Questions 🚀
  6. Your application experiences unpredictable traffic spikes. How do you configure Auto Scaling to handle them?
  7. How can you ensure Auto Scaling launches instances in multiple AZs for high availability?
  8. You want to scale EC2 instances based on memory utilization, but it’s not a default metric. How do you achieve this?
  9. Your Auto Scaling Group is scaling too frequently (thrashing). How do you fix it?
  10. What happens when an instance in the Auto Scaling Group fails a health check?
  11. How do you configure scheduled scaling (scale up during business hours, scale down at night)?
  12. When should you use step scaling vs target tracking scaling?
  13. How do you integrate an Auto Scaling Group with an Application Load Balancer?
  14. How can Auto Scaling help reduce EC2 costs in production?
  15. Your ASG keeps launching instances but they immediately fail. How do you troubleshoot?
  16. How do you enforce that Auto Scaling launches instances with the latest AMI?
  17. Your application must always run at least 2 instances. How do you guarantee this?
  18. How do you configure Auto Scaling for Spot Instances while avoiding sudden interruptions?
  19. Your app has a long startup time. How do you adjust scaling policies?
  20. How do you ensure graceful shutdown of instances during scale-in events?
  21. What happens if one of the AZs in your ASG becomes unavailable?
  22. How would you test your Auto Scaling policies under simulated traffic?
  23. How do you handle sticky sessions with Auto Scaling behind a load balancer?
  24. You need to handle batch jobs with Auto Scaling only once per week. How do you design it?
  25. What are some strategies for using Auto Scaling in a multi-cloud or hybrid environment?

Scenario Based DevOps Interview Questions and Answers

How do you implement CI/CD rollbacks automatically?
Answer: Pipeline detects failure → Triggers kubectl rollout undo or redeploys last known good artifact → Notifies team.

How do you troubleshoot slow Terraform apply?
Answer: Reduce resource count per state → Use -parallelism flag → Split infra into modules → Optimize provider API calls.

How do you ensure Docker image immutability?
Answer: Tag images with version/commit hash → Push immutable tags to registry → Prevent latest usage in pipelines.

How do you troubleshoot Azure Kubernetes Service (AKS) scaling issues?
Answer: Check cluster autoscaler logs → Verify VM quotas in Azure → Ensure correct resource requests/limits.

How do you handle Jenkins credentials securely?
Answer: Store in Jenkins Credentials Manager → Inject at runtime → Rotate periodically → Integrate with Vault/Key Vault.

How do you manage stateful applications in Kubernetes?
Answer: Use StatefulSets → PersistentVolumeClaims → Ensure proper storage class → Backup with Velero.

How do you monitor CI/CD pipeline performance?
Answer: Enable Jenkins Prometheus plugin → Visualize in Grafana → Track build duration, failure rate, queue time.

How do you troubleshoot GCP Cloud Build quota exceeded error?
Answer: Check quotas in GCP console → Optimize build concurrency → Request quota increase → Split builds.

How do you enforce policy-as-code in Terraform?
Answer: Use Sentinel (Terraform Cloud) or OPA/Conftest → Define rules (naming, tags, security) → Enforce in pipeline.

How do you handle Kubernetes secret exposure in logs?
Answer: Prevent kubectl describe from showing → Use kubectl get secret -o jsonpath securely → Audit RBAC → Enable encryption at rest.

Terraform interview Questions

1) What is the difference between 𝐭𝐞𝐫𝐫𝐚𝐟𝐨𝐫𝐦 𝐢𝐦𝐩𝐨𝐫𝐭 and 𝐭𝐞𝐫𝐫𝐚𝐟𝐨𝐫𝐦 𝐭𝐚𝐢𝐧𝐭?
2) How do you manage secrets in Terraform without hardcoding them?
3) What’s the difference between 𝐜𝐨𝐮𝐧𝐭 and 𝐟𝐨𝐫_𝐞𝐚𝐜𝐡? Give a real-world use case.
4) How do you handle drift detection in Terraform?
5) What is a Terraform remote backend, and why is it important?
6) How do you manage multiple environments (dev, staging, prod) in Terraform?
7) Difference between 𝐥𝐨𝐜𝐚𝐥-𝐞𝐱𝐞𝐜 and 𝐫𝐞𝐦𝐨𝐭𝐞-𝐞𝐱𝐞𝐜 provisioners.
8) How do you safely roll back infrastructure changes after a failed deployment?
9) Explain 𝐭𝐞𝐫𝐫𝐚𝐟𝐨𝐫𝐦 𝐫𝐞𝐟𝐫𝐞𝐬𝐡 vs 𝐭𝐞𝐫𝐫𝐚𝐟𝐨𝐫𝐦 𝐩𝐥𝐚𝐧.
10) How do you write reusable Terraform modules?

High-level EC2 scenario-based questions to challenge your AWS & DevOps skills

  1. Your EC2 instance is running but you can’t connect via SSH. What troubleshooting steps will you take? Check Security Group inbound rules (port 22 open to your IP).
    Verify Network ACLs (NACLs not blocking inbound/outbound).
    Confirm instance’s Public IP / Elastic IP.
    Validate Key Pair and correct permissions on .pem.
    Ensure SSM Agent is installed (Session Manager can help).
    Check system logs on the console for OS-level issues.
  2. You terminated an EC2 instance by mistake. How can you prevent this in the future?

Enable Termination Protection in EC2 settings.
Use IAM permissions to restrict TerminateInstances.
Tag critical instances and set resource policies.

  1. Your EC2 instance needs to access an S3 bucket securely. What’s the best way to configure this?

Best practice: Attach an IAM Role with least privilege policy to the EC2 instance.
Avoid hardcoding credentials or using access keys.

  1. An application hosted on EC2 needs to be highly available across AZs. How will you achieve it?

Use an Auto Scaling Group (ASG) spanning multiple AZs.
Place EC2 instances behind an Elastic Load Balancer (ALB/NLB).
Store shared data in EFS, S3, or RDS Multi-AZ.

  1. You need to run scheduled scripts on EC2 daily. What approaches are available?

Use cron jobs inside EC2 for OS-level scheduling.
Or AWS Systems Manager Automation Documents.
Or trigger scripts from EventBridge / CloudWatch Events to call SSM Run Command.

  1. How will you enable auto-scaling for EC2 based on CPU utilization?

Create an Auto Scaling Group with a Launch Template.
Define a CloudWatch alarm on CPUUtilization.
Attach a scaling policy (step or target tracking).

  1. You’re seeing high latency between EC2 and RDS in the same region. What might be wrong?

Verify EC2 and RDS are in the same VPC and AZ.
Check security groups and subnet routing.
Ensure DNS resolution is correct (use private endpoint).
Check instance type & network performance (Enhanced Networking for EC2).

  1. You need to move an EC2 instance to another region. What are your options?
    Create an AMI of the instance and copy AMI to the target region, then launch.
    Or take an EBS snapshot and copy to the other region, then create a volume.
    For full migration, use AWS MGN or third-party tools.
  2. Your EC2 disk space keeps filling up. How do you investigate and fix this?

SSH into the instance, run df -h and du -sh /* to find large directories.
Rotate or offload logs to CloudWatch Logs or S3.
Expand EBS volume size or use EBS Elastic Volumes.
Automate cleanup (logrotate, tmp cleaner).

  1. You have to reduce EC2 costs without affecting performance. Which AWS features can you use?

Use Right Sizing (smaller instance types).
Spot Instances or Savings Plans for predictable workloads.
Turn off non-production EC2 during off-hours (use Instance Scheduler).
Consider Graviton-based instances for better price/performance.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top