DevOps Interview Questions and Answers for Intermediate-Level Engineers
#architecture
#distributed-system
#devops-automation
If you've already learned the basics of DevOps and are preparing for interviews, the next step is understanding how DevOps works in real production environments.
At the intermediate level, interviewers usually move beyond simple definitions. Instead of asking "What is CI/CD?" or "What is Docker?", they'll want to know how you've used these technologies, why you chose a particular solution and how you would handle real-world deployment or infrastructure challenges.
That's why this guide focuses on practical DevOps interview questions that are commonly asked for candidates with 1–4 years of experience.
The questions cover topics you'll frequently encounter in interviews, including Docker, Kubernetes, Jenkins, Git, Linux, CI/CD pipelines, Terraform, Ansible, cloud platforms such as AWS, Azure and Google Cloud, monitoring, logging, deployment strategies, networking and infrastructure automation.
The explanations are kept simple and practical so that you understand the concept instead of memorizing definitions.
New to DevOps? Start with the Fundamentals First
If you're just beginning your DevOps journey, it's worth spending some time on the basics before jumping into intermediate concepts. Topics like Kubernetes, Terraform or advanced CI/CD pipelines become much easier to understand once you're comfortable with Git, Linux, Docker, CI/CD and cloud fundamentals.
If you haven't covered those topics yet, we recommend reading our beginner's guide first: DevOps Interview Questions for Freshers: Top 35 Questions & Answers
It covers the concepts that almost every fresher interview starts with, including:
- What is DevOps?
- CI/CD and deployment basics
- Git fundamentals and common commands
- Docker and Virtual Machines
- Infrastructure as Code (IaC)
- Jenkins
- SSH
- AWS basics
- Linux fundamentals
- Configuration Management
- Blue-Green Deployment
Once you're comfortable with these topics, come back to this guide and continue with the intermediate interview questions. You'll find them much easier to understand and you'll be better prepared to answer practical, scenario-based questions during interviews.
1. What is the Component-Based Model (CBM) in DevOps?
The Component-Based Model (CBM) is a software design approach where an application is built by combining reusable components instead of creating everything from scratch. Each component performs a specific task and can be developed, tested and maintained independently. Since components are reusable, development becomes faster and maintaining large applications becomes much easier.
For example, an authentication module or a payment module can be reused across multiple applications instead of building it every time.
2. How do you create a CI/CD pipeline in Jenkins?
A Jenkins pipeline automates the process of building, testing and deploying an application whenever new code is pushed to a repository.
The basic steps are:
- Install Jenkins and the required plugins.
- Connect Jenkins to your Git repository.
- Configure tools such as JDK, Maven, Node.js or Docker.
- Add the required credentials.
- Create a Pipeline or Multibranch Pipeline job.
- Add a Jenkinsfile to your project.
- Define pipeline stages like Build → Test → Deploy.
- Configure Git webhooks so the pipeline runs automatically after every commit.
- Monitor builds using Jenkins logs and reports.
This helps teams release software faster while reducing manual work and deployment errors.
3. What's the difference between Chef and Puppet?
Both Chef and Puppet are configuration management tools used to automate server configuration and infrastructure management.
| Chef | Puppet |
|---|---|
| Uses Ruby for writing configurations. | Uses its own declarative language (Puppet DSL). |
| Gives developers more flexibility. | Easier for managing large infrastructures. |
| More procedural approach. | More declarative approach. |
| Popular in environments requiring custom automation. | Commonly used in large enterprise environments. |
Both tools solve the same problem and the choice usually depends on the organization's requirements.
4. What is Git Rebase?
Git Rebase is used to move or replay commits from one branch onto another. Unlike a merge, rebase creates a cleaner and more linear commit history, making the project history easier to read.
For example, before merging a feature branch into main, developers often rebase it so it includes the latest changes from the main branch.
git rebase main
Rebasing is useful for keeping commit history clean, but it should be avoided on shared branches because it rewrites commit history.
5. What is the Selenium Tool Suite?
The Selenium Tool Suite is a collection of tools used for automating web browser testing.
It includes:
- Selenium IDE – Records and plays back browser actions.
- Selenium WebDriver – Automates browsers using programming languages like Java, Python or C#.
- Selenium Grid – Runs tests across multiple browsers and machines simultaneously.
- Selenium RC – An older component that has now been replaced by WebDriver.
6. What is Selenium IDE?
Selenium IDE is a browser extension that records your actions on a website and converts them into automated test cases. It's a good choice for beginners because it doesn't require much programming knowledge. Developers mainly use it to create simple UI tests or quickly prototype automation scripts.
7. How do you create backups and copy files in Jenkins?
The easiest way to back up Jenkins is by creating a copy of the JENKINS_HOME directory because it contains all jobs, plugins, configurations and build history. To copy files during a pipeline, you can use shell commands.
For Linux:
cp source destination
For Windows:
copy source destination
Many teams also use plugins like ThinBackup to schedule automatic Jenkins backups.
8. How do you create a Jenkins job?
Creating a Jenkins job is straightforward.
- Open the Jenkins dashboard.
- Click New Item.
- Enter a job name.
- Select the project type (Freestyle or Pipeline).
- Configure the Git repository.
- Add build triggers.
- Configure build and deployment steps.
- Save the configuration.
- Click Build Now to execute the job.
Once configured, Jenkins can automatically build and deploy the application whenever new code is pushed.
9. Explain Docker architecture.
Docker follows a client-server architecture. Its main components are:
- Docker Client – Accepts Docker commands from the user.
- Docker Daemon (dockerd) – Builds and manages images, containers, networks and volumes.
- Docker Images – Read-only templates used to create containers.
- Docker Containers – Running instances of Docker images.
- Docker Registry – Stores Docker images (Docker Hub is the most popular registry).
- Docker Compose – Manages multi-container applications using a YAML file.
Together, these components make it easy to build, ship and run applications consistently across different environments.
10. What is the DevOps lifecycle?
The DevOps lifecycle describes the stages involved in developing, releasing and maintaining software. It is a continuous cycle rather than a one-time process. The major stages are:
- Continuous Planning
- Continuous Development
- Continuous Integration
- Continuous Testing
- Continuous Deployment (or Continuous Delivery)
- Continuous Monitoring
- Continuous Feedback
- Continuous Operations
Each phase helps teams release software faster while maintaining quality and reliability.
11. What is the difference between Git Merge and Git Rebase?
Both commands combine changes from different branches, but they work differently.
| Git Merge | Git Rebase |
|---|---|
| Preserves complete commit history. | Creates a cleaner, linear history. |
| Adds a merge commit. | Doesn't create a merge commit. |
| Safer for shared branches. | Best for local feature branches. |
| Easier for beginners. | Requires more care because it rewrites history. |
A common interview answer is:
Use Merge when preserving history is important. Use Rebase when you want a clean commit history before merging.
12. What's the difference between DataOps and DevOps?
Although the names sound similar, they solve different problems.
| DataOps | DevOps |
|---|---|
| Focuses on managing data pipelines and analytics. | Focuses on building, testing and deploying software. |
| Used by data engineers and analytics teams. | Used by software development and operations teams. |
| Improves data quality, reliability and availability. | Improves software delivery speed and reliability. |
| Automates data workflows. | Automates software development and deployment workflows. |
In simple terms, DataOps manages data, while DevOps manages software delivery.
13. What are the 7 Cs of DevOps?
The 7 Cs represent the continuous practices followed in DevOps.
- Continuous Development
- Continuous Integration
- Continuous Testing
- Continuous Delivery
- Continuous Deployment
- Continuous Monitoring
- Continuous Feedback
Some organizations also include Continuous Operations as an additional practice. Together, these practices help teams build, test, release, monitor and improve software continuously.
14. Explain the "Shift Left" concept in DevOps.
"Shift Left" means moving testing, security checks and code quality reviews earlier in the software development process instead of waiting until the end.
For example, instead of finding security issues after deployment, teams run security scans during development or as part of the CI/CD pipeline. By identifying problems early, developers can fix them faster and at a much lower cost.
In short, the earlier you detect a problem, the easier and cheaper it is to fix.
15. What is Infrastructure as Code (IaC)? What are its benefits and challenges?
Infrastructure as Code (IaC) is the practice of managing infrastructure using code instead of configuring servers and cloud resources manually.
For example, instead of creating virtual machines, networks and databases through the AWS console every time, you can define everything in code using tools like Terraform, AWS CloudFormation or Pulumi. Whenever you need the same environment, you simply execute the code. This approach makes infrastructure easier to manage, especially in large projects.
Benefits of IaC
- Faster infrastructure provisioning
- Consistent environments across development, testing and production
- Easy to version and review changes using Git
- Reduces manual errors
- Makes scaling and disaster recovery much simpler
Challenges of IaC
- Requires learning IaC tools and best practices
- Managing large infrastructure codebases can become complex
- Secrets and credentials must be handled securely
- Poorly written infrastructure code can impact production systems
16. How can you achieve zero-downtime deployments?
Zero-downtime deployment means releasing a new version of an application without interrupting users. Instead of stopping the existing application and replacing it with a new version, the new version is deployed while the current version is still running. Once everything is verified, user traffic is gradually switched to the new version.
Some popular deployment strategies include:
- Blue-Green Deployment – Maintain two production environments and switch traffic once the new version is ready.
- Canary Deployment – Release the update to a small percentage of users first, then gradually increase the rollout.
- Rolling Deployment – Update application instances one by one instead of replacing them all at once.
These strategies reduce deployment risk and make rollbacks much easier if something goes wrong.
17. How do you secure a CI/CD pipeline?
A CI/CD pipeline has access to source code, production servers and deployment credentials, so securing it is essential. Some common security practices include:
- Store secrets in a secure vault instead of hardcoding them.
- Use role-based access control (RBAC).
- Enable Multi-Factor Authentication (MFA).
- Scan dependencies and container images for vulnerabilities.
- Run automated security tests as part of the pipeline.
- Rotate API keys and access tokens regularly.
- Keep detailed audit logs of pipeline activities.
The idea is to identify security issues as early as possible rather than after deployment.
18. Why are monitoring and logging important in DevOps?
Building and deploying an application is only part of the job. Once the application is live, you need to know whether it's working correctly. That's where monitoring and logging become important.
-
Monitoring tracks the health and performance of applications, servers and infrastructure in real time.
-
Logging records application events and errors, making it easier to investigate problems.
Some commonly used tools include:
- Prometheus
- Grafana
- ELK Stack
- Loki
- Splunk
- AWS CloudWatch
Good monitoring helps teams detect issues early, while centralized logging makes troubleshooting much faster.
19. What is Immutable Infrastructure?
Immutable Infrastructure is an approach where servers are never modified after they're deployed.
If you need to update an application or operating system, you don't log in and make changes manually. Instead, you create a new server or container with the updated configuration and replace the old one.
This approach offers several advantages:
- Consistent environments
- Easier rollbacks
- Reduced configuration drift
- Better reliability
The main challenge is handling applications that store data locally, as they require additional planning for persistent storage.
20. What is Serverless Computing?
Serverless computing is a cloud model where developers focus only on writing application code while the cloud provider manages the servers behind the scenes. You don't have to provision servers, install operating systems or worry about scaling infrastructure.
Popular serverless services include:
- AWS Lambda
- Azure Functions
- Google Cloud Functions
Some advantages of serverless computing are:
- No server management
- Automatic scaling
- Pay only for actual usage
- Faster application development
Serverless works particularly well for APIs, event-driven applications, scheduled tasks and background jobs.
21. What are Blue-Green and Canary Deployments?
Both Blue-Green and Canary deployments reduce deployment risk, but they release new versions differently.
Blue-Green Deployment
Two identical production environments are maintained.
- Blue contains the current stable version.
- Green contains the new version.
Once testing is complete, all user traffic is switched to the Green environment. If any issue occurs, traffic can immediately be redirected back to Blue.
Canary Deployment
Instead of switching everyone at once, the new version is released gradually. For example:
- 5% of users receive the new version.
- If everything works correctly, increase the rollout to 20%, then 50% and finally 100%.
Canary deployments reduce risk because only a small group of users is affected if something goes wrong.
22. How do you optimize a Docker container for better performance?
Optimizing Docker images improves build speed, reduces storage usage and makes deployments faster. Some common best practices are:
- Use lightweight base images such as Alpine.
- Remove unnecessary packages and files.
- Use multi-stage builds.
- Minimize Docker image layers.
- Cache dependencies whenever possible.
- Avoid running containers as the root user.
- Keep images small by installing only production dependencies.
Smaller images download faster, start quicker and consume fewer resources.
23. How do you perform a rollback in Kubernetes?
If a deployment introduces an issue, Kubernetes allows you to roll back to the previous working version. The most common command is:
kubectl rollout undo deployment <deployment-name>
Kubernetes stores deployment history, making rollbacks quick and reliable.
If you're using Helm, you can also roll back using:
helm rollback <release-name> <revision>
Keeping deployment history makes recovering from failed releases much easier.
24. How do you optimize a CI/CD pipeline for faster deployments?
A slow CI/CD pipeline delays development and reduces team productivity. Some effective optimization techniques include:
- Cache dependencies between builds.
- Run independent tests in parallel.
- Build only modified components instead of the entire project.
- Reuse Docker image layers.
- Skip unnecessary jobs for documentation-only changes.
- Automate deployments.
- Use incremental builds whenever possible.
The goal isn't just to make the pipeline faster, but also to keep it reliable.
25. What are Sidecar Containers in Kubernetes?
A Sidecar Container is an additional container that runs alongside the main application container inside the same Kubernetes Pod. Instead of adding extra responsibilities to the application, these tasks are handled by the sidecar.
Common sidecar use cases include:
- Log collection
- Monitoring
- Service proxy
- Security
- Configuration updates
Since both containers share the same network and storage, they can work together efficiently while keeping the application code clean.
26. What is the difference between Monolithic, SOA and Microservices Architecture?
These are three different approaches to designing software applications.
| Feature | Monolithic | SOA | Microservices | | | -- | -- | | | Architecture | Single application | Collection of enterprise services | Collection of small independent services | | Deployment | Entire application is deployed together | Services may be deployed independently but often depend on shared infrastructure | Every service can be deployed independently | | Communication | Internal method calls | Usually through an Enterprise Service Bus (ESB) | REST APIs, gRPC or messaging systems | | Scalability | Scale the whole application | Partial service scaling | Scale individual services independently | | Technology | Usually one technology stack | Often follows enterprise standards | Each service can use its own technology stack | | Failure Impact | One failure can affect the whole application | Shared components may become bottlenecks | Failures are isolated to individual services |
When should you use each?
- Monolithic Architecture is a good choice for small projects and startups.
- SOA (Service-Oriented Architecture) works well for large enterprise systems that integrate multiple business applications.
- Microservices Architecture is ideal for large, cloud-native applications that require independent deployments, high scalability and faster development.
