DEV Community

Cover image for 🚀 CI/CD Interview Questions & Answers for Beginners
Hritik ranjan
Hritik ranjan

Posted on

🚀 CI/CD Interview Questions & Answers for Beginners

🚀 CI/CD Interview Questions & Answers for Beginners

1. What is CI/CD?

Answer:

CI/CD stands for Continuous Integration and Continuous Delivery/Deployment.

  • Continuous Integration (CI) means developers frequently merge their code into a shared repository where automated builds and tests are executed.
  • Continuous Delivery/Deployment (CD) means automatically deploying tested code to development, staging, or production environments.

Real-Life Example:

Imagine a team of 10 developers working on the same application. Instead of manually building and testing after every code change, CI/CD automates the entire process, reducing errors and speeding up releases.


2. Explain the CI/CD Process in Your Current Project.

Answer:

In our project, we use:

  • GitHub
  • Jenkins
  • Maven
  • SonarQube
  • AppScan/Trivy
  • ArgoCD
  • Kubernetes
  • Prometheus & Grafana

CI/CD Workflow:

Step 1: Developer pushes code to GitHub.

Step 2: Jenkins pipeline gets triggered automatically.

Step 3: Maven builds the application and executes unit tests.

Step 4: SonarQube performs code quality analysis.

Step 5: Security tools scan for vulnerabilities.

Step 6: Docker image is created.

Step 7: Image is pushed to a container registry.

Step 8: ArgoCD deploys the application to Kubernetes.

Step 9: Prometheus and Grafana monitor the application.

Real-Life Scenario:

Whenever developers commit code, the complete build, testing, scanning, and deployment process happens automatically without manual intervention.


3. What are the Different Ways to Trigger a Jenkins Pipeline?

Answer:

Webhook Trigger

GitHub sends an event to Jenkins whenever code is pushed.

Most commonly used method.

Poll SCM

Jenkins checks the repository periodically.

Example:

H/5 * * * *
Enter fullscreen mode Exit fullscreen mode

Checks every 5 minutes.

Build Trigger

One Jenkins job can trigger another Jenkins job.

Manual Trigger

Users manually click Build Now.

Scheduled Trigger

Jobs can run at specific times using Cron syntax.

Real-Life Scenario

Whenever a developer pushes code to GitHub, a webhook immediately triggers Jenkins to start the pipeline.


4. How Do You Backup Jenkins?

Answer:

Important Jenkins components to backup:

Jenkins Home Directory

/var/lib/jenkins
Enter fullscreen mode Exit fullscreen mode

Contains:

  • Jobs
  • Plugins
  • Credentials
  • Build History
  • Configurations

Plugin Backup

JENKINS_HOME/plugins
Enter fullscreen mode Exit fullscreen mode

Job Backup

JENKINS_HOME/jobs
Enter fullscreen mode Exit fullscreen mode

Best Practice

Schedule automatic backups using:

  • Cron Jobs
  • AWS Backup
  • Snapshots
  • Cloud Storage

Real-Life Scenario

If Jenkins server crashes, backup helps restore all pipelines and configurations quickly.


5. How Do You Store Secrets in Jenkins?

Answer:

Jenkins Credentials Plugin

Used to securely store:

  • Passwords
  • API Keys
  • SSH Keys
  • Certificates

HashiCorp Vault

Enterprise-level secret management.

Cloud Secret Managers

Examples:

  • AWS Secrets Manager
  • Azure Key Vault
  • Google Secret Manager

Avoid

❌ Hardcoding passwords in Jenkinsfiles.

Real-Life Scenario

Instead of writing database passwords in code, Jenkins retrieves them securely from Vault during deployment.


6. What is the Latest Version of Jenkins You Are Using?

Answer:

Interviewers ask this question to verify whether you actually work with Jenkins regularly.

You should always know:

  • Current Jenkins Version
  • LTS Version
  • Recently used version in your project

Example Answer:

"We are currently using Jenkins LTS version in our production environment."


7. What are Shared Libraries in Jenkins?

Answer:

Shared Libraries allow reusable pipeline code across multiple projects.

Instead of writing the same pipeline logic repeatedly, teams store common functions in one location.

Benefits

  • Reusability
  • Consistency
  • Easy Maintenance
  • Reduced Duplication

Real-Life Scenario

A deployment function can be written once and used by 50 different projects.


8. Can Jenkins Build Applications with Multiple Programming Languages?

Answer:

Yes.

Jenkins supports multiple agents and environments.

Example:

Stage 1

Java Application

mvn clean package
Enter fullscreen mode Exit fullscreen mode

Stage 2

Node.js Application

npm install
npm test
Enter fullscreen mode Exit fullscreen mode

Stage 3

Python Application

pytest
Enter fullscreen mode Exit fullscreen mode

Real-Life Scenario

A microservices application may contain:

  • Java Backend
  • Node.js Frontend
  • Python Automation Scripts

Jenkins can build all of them using different agents.


9. How Can You Set Up Auto Scaling for Jenkins in AWS?

Answer:

High-Level Steps

  1. Create EC2 Instance
  2. Install Jenkins
  3. Create AMI
  4. Create Launch Template
  5. Create Auto Scaling Group
  6. Configure Scaling Policies
  7. Attach Load Balancer
  8. Monitor using CloudWatch

Benefits

  • High Availability
  • Automatic Scaling
  • Better Performance

Real-Life Scenario

During heavy deployment hours, AWS automatically launches additional Jenkins agents.


10. How Do You Add a New Worker Node in Jenkins?

Answer:

Steps

  1. Manage Jenkins
  2. Manage Nodes
  3. New Node
  4. Configure Node Name
  5. Add SSH Credentials
  6. Launch Agent

Why Worker Nodes?

Worker nodes distribute build workloads and improve scalability.

Real-Life Scenario

Instead of running all builds on a single Jenkins server, builds run on multiple worker machines.


11. What is JNLP in Jenkins?

Answer:

JNLP stands for:

Java Network Launch Protocol

It allows Jenkins agents to connect to the Jenkins Controller remotely.

Why Use JNLP?

  • Remote Agents
  • Cloud Agents
  • Dynamic Scaling
  • Kubernetes Agents

Real-Life Scenario

A Jenkins agent running inside Kubernetes can connect back to the Jenkins Controller using JNLP.


12. What Are Some Common Jenkins Plugins You Use?

Answer:

Git Plugin

Source code integration.

Pipeline Plugin

Pipeline support.

Docker Plugin

Docker builds and containers.

Kubernetes Plugin

Dynamic Kubernetes agents.

SonarQube Plugin

Code quality analysis.

Slack Plugin

Notifications.

Blue Ocean

Modern Jenkins UI.

Real-Life Scenario

A CI/CD pipeline often uses Git, SonarQube, Docker, and Slack plugins together.


13. GitHub Actions vs Jenkins?

Answer:

Feature Jenkins GitHub Actions
Hosting Self-hosted GitHub Managed
Setup Complex Easy
Maintenance High Low
Cost Infrastructure Required Free for Public Repositories
Plugins Large Ecosystem Marketplace Actions
Integration Multiple Platforms GitHub Focused

14. What Are the Advantages of GitHub Actions?

Answer:

Easy Setup

Create:

.github/workflows/
Enter fullscreen mode Exit fullscreen mode

and start building workflows.

No Server Maintenance

GitHub manages infrastructure.

Cost Effective

Free for public repositories.

Better Integration

Works seamlessly with GitHub repositories.

Real-Life Scenario

Small startups often choose GitHub Actions because they don't want to maintain Jenkins servers.


15. What Are the Advantages of Jenkins?

Answer:

Platform Independent

Supports:

  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps

Huge Plugin Ecosystem

Thousands of plugins available.

Highly Customizable

Suitable for enterprise environments.

Real-Life Scenario

Large organizations prefer Jenkins because it can integrate with almost any tool.


🎯 Real-Time Scenario Based Interview Questions

16. Your Deployment Failed After a Code Merge. What Will You Do?

Answer:

  1. Check Jenkins Console Logs.
  2. Verify Git Changes.
  3. Review SonarQube Reports.
  4. Check Docker Build Logs.
  5. Verify Kubernetes Pods.
kubectl get pods
kubectl describe pod <pod-name>
kubectl logs <pod-name>
Enter fullscreen mode Exit fullscreen mode
  1. Rollback Deployment if needed.
kubectl rollout undo deployment/app
Enter fullscreen mode Exit fullscreen mode

17. How Would You Secure a CI/CD Pipeline?

Answer:

  • Store secrets in Vault or Credentials Manager.
  • Enable RBAC.
  • Use Security Scanning Tools.
  • Restrict Production Access.
  • Encrypt Sensitive Data.
  • Enable Audit Logs.

Real-Life Scenario

A leaked API key can compromise the entire infrastructure. Proper secret management prevents such incidents.


18. Why Do Companies Use ArgoCD with Jenkins?

Answer:

Jenkins handles CI tasks:

  • Build
  • Test
  • Security Scan
  • Docker Image Creation

ArgoCD handles CD tasks:

  • Kubernetes Deployment
  • GitOps
  • Rollbacks
  • Desired State Management

Real-Life Scenario

Developer pushes code → Jenkins builds image → Git repo updated → ArgoCD automatically deploys to Kubernetes.


🚀 Final Interview Tip

For DevOps interviews, be comfortable explaining:

✅ CI/CD Workflow

✅ Jenkins Pipeline

✅ GitHub Actions

✅ Docker Integration

✅ Kubernetes Deployment

✅ ArgoCD GitOps

✅ Secrets Management

✅ Monitoring (Prometheus & Grafana)

✅ Troubleshooting Failed Deployments

These topics cover most beginner-to-intermediate CI/CD interview questions asked in DevOps interviews.

Top comments (0)