Advanced & Scenario-Based CI/CD Interview Questions and Answers


 

Advanced & Scenario-Based CI/CD Interview Questions and Answers

1. A deployment failed in production. What would you do?

Answer:

  1. Check pipeline logs.

  2. Identify the failed stage.

  3. Verify application logs.

  4. Roll back to the previous stable version.

  5. Fix the issue in a lower environment.

  6. Re-run the pipeline.


2. Your Jenkins build is failing but developers claim the code is working locally. How would you troubleshoot?

Answer:

  • Check Jenkins console output.

  • Verify build tools and versions.

  • Compare local and Jenkins environments.

  • Check credentials and environment variables.

  • Verify dependency downloads.

  • Review recent code changes.


3. How would you implement a zero-downtime deployment?

Answer:

Using:

  • Blue-Green Deployment

  • Canary Deployment

  • Rolling Updates in Kubernetes

These strategies ensure users continue accessing the application during deployment.


4. A pipeline suddenly takes 45 minutes instead of 10 minutes. How would you investigate?

Answer:

  • Analyze pipeline stage duration.

  • Check build server CPU and memory.

  • Review network latency.

  • Verify dependency downloads.

  • Check test execution time.

  • Examine Kubernetes or Docker performance.


5. How would you secure a CI/CD pipeline?

Answer:

  • Use Jenkins Credentials Manager.

  • Store secrets in Vault.

  • Enable RBAC.

  • Use SonarQube and Trivy scans.

  • Implement least-privilege access.

  • Rotate secrets regularly.


6. What happens if a deployment succeeds but the application is not accessible?

Answer:

Check:

  • Application logs

  • Kubernetes Pods

  • Service configuration

  • Ingress configuration

  • Load Balancer health checks

  • Security Groups and Firewall rules


7. How would you handle database changes in a CI/CD pipeline?

Answer:

Use:

  • Flyway

  • Liquibase

Database migrations should be version-controlled and executed automatically during deployment.


8. How do you implement rollback in Kubernetes?

Answer:

kubectl rollout undo deployment app-name

Rollback restores the previous stable deployment version.


9. What would you do if a production deployment introduces critical bugs?

Answer:

  • Stop further deployments.

  • Roll back immediately.

  • Analyze root cause.

  • Fix the issue.

  • Deploy through the standard pipeline.


10. How would you deploy to multiple environments?

Answer:

Pipeline Flow:

Development → Testing → Staging → Production

Each environment should have:

  • Separate configurations

  • Separate credentials

  • Approval gates before production


Real Production Scenarios

11. CPU usage suddenly reaches 100% after deployment. What would you do?

Answer:

  • Compare new and previous versions.

  • Check application logs.

  • Analyze Prometheus metrics.

  • Scale pods temporarily.

  • Roll back if required.


12. One Kubernetes Pod keeps crashing after deployment.

Answer:

Check:

kubectl logs pod-name
kubectl describe pod pod-name

Common causes:

  • Configuration issues

  • Missing secrets

  • Application bugs

  • Resource limits


13. Docker image works locally but fails in production. Why?

Answer:

Possible reasons:

  • Missing environment variables

  • Network restrictions

  • Different architecture

  • Missing dependencies

  • Volume mounting issues


14. How would you prevent bad code from reaching production?

Answer:

Implement:

  • Unit Tests

  • Integration Tests

  • SonarQube Scanning

  • Security Scanning

  • Manual Approval Gates


15. What would you monitor after deployment?

Answer:

  • CPU Usage

  • Memory Usage

  • Error Rates

  • Response Time

  • Pod Health

  • Application Logs

Tools:

  • Prometheus

  • Grafana

  • ELK Stack


Senior-Level CI/CD Questions

16. Difference between Continuous Delivery and Continuous Deployment?

Continuous Delivery

Requires manual approval before production.

Continuous Deployment

Automatically deploys to production after successful testing.


17. How would you design an enterprise-grade CI/CD pipeline?

Pipeline Flow

GitHub

Jenkins

SonarQube

Unit Tests

Docker Build

Trivy Scan

Docker Registry

Staging Deployment

Approval

Production Deployment

Monitoring


18. How do you manage secrets in CI/CD?

Answer:

Avoid hardcoding credentials.

Use:

  • HashiCorp Vault

  • AWS Secrets Manager

  • Jenkins Credentials

  • Kubernetes Secrets


19. What is GitOps and how does it improve CI/CD?

Answer:

GitOps uses Git as the source of truth.

Benefits:

  • Easy Rollback

  • Audit Trail

  • Automated Deployment

  • Better Security

Tools:

  • Argo CD

  • Flux CD


20. Explain a CI/CD pipeline you would build for a microservices application.

Answer:

  1. Developer pushes code.

  2. Jenkins triggers builds.

  3. Unit tests execute.

  4. SonarQube scans code.

  5. Docker image created.

  6. Trivy security scan.

  7. Push image to ECR.

  8. Argo CD updates Kubernetes.

  9. Prometheus monitors services.

  10. Grafana visualizes metrics.

This is a common production-grade architecture used by modern organizations.

Comments

Popular posts from this blog

DevOps Roadmap 2026 – Your Complete Beginner-to-Expert Guide

User Management in Linux – Complete Notes for Beginners