Which of the following commands would you use to stop or disable the ‘httpd’ service when the system boots?
- # systemctl disable httpd.service
- # system disable httpd.service
- # system disable httpd
- # systemctl disable httpd.service
The correct answer is A) # systemctl disable httpd.service
What is Test Kitchen in Chef?
Test Kitchen is a command-line tool in Chef that spins up an instance and tests the cookbook on it before deploying it on the actual nodes.
Here are the most commonly used kitchen commands:

How does chef-apply differ from chef-client?
- chef-apply is run on the client system.
chef-apply applies the recipe mentioned in the command on the client system.
$ chef-apply recipe_name.rb - chef-client is also run on the client system.
chef-client applies all the cookbooks in your server’s run list to the client system.
$ knife chef-client
DevOps Interview Question
What is the command to sign the requested certificates?
- For Puppet version 2.7:
# puppetca –sign hostname-of-agent
Example:
# puppetca –sign ChefAgent
# puppetca sign hostname-of-agent
Example:
# puppetca sign ChefAgent - For Puppet version 2.7:
# puppetca –sign hostname-of-agent
Example:
# puppetca –sign ChefAgent
# puppetca sign hostname-of-agent
Example:
# puppetca sign ChefAgent
Which open source or community tools do you use to make Puppet more powerful?
- Changes in the configuration are tracked using Jira, and further maintenance is done through internal procedures.
- Version control takes the support of Git and Puppet’s code manager app.
- The changes are also passed through Jenkin’s continuous integration pipeline.
What are the resources in Puppet?
- Resources are the basic units of any configuration management tool.
- These are the features of a node, like their software packages or services.
- A resource declaration, written in a catalog, describes the action to be performed on or with the resource.
- When the catalog is executed, it sets the node to the desired state.
Advance DevOps Interview Question
What is a class in Puppet?
Classes are named blocks in your manifest that configure various functionalities of the node, such as services, files, and packages.
The classes are added to a node’s catalog and are executed only when explicitly invoked.
Class apache (String $version = ‘latest’) {
package{
‘httpd’: ensure => $version,
before => File[‘/etc/httpd.conf’],}
What is an Ansible role?
An Ansible role is an independent block of tasks, variables, files, and templates embedded inside a playbook.

This playbook installs tomcat on node1.
When should I use ‘{{ }}’?
Always use {{}} for variables, unless you have a conditional statement, such as “when: …”. This is because conditional statements are run through Jinja, which resolves the expressions.
For example:
echo “This prints the value of {{foo}}”
when : foo is defined
Using brackets makes it simpler to distinguish between strings and undefined variables.

This also ensures that Ansible doesn’t recognize the line as a dictionary declaration.
DevOps Interview Question
What is the best way to make content reusable/redistributable?
There are three ways to make content reusable or redistributable in Ansible:
- Roles are used to managing tasks in a playbook. They can be easily shared via Ansible Galaxy.
- “include” is used to add a submodule or another file to a playbook. This means a code written once can be added to multiple playbooks.
- “import” is an improvement of “include,” which ensures that a file is added only once. This is helpful when a line is run recursively.
How is Ansible different from Puppet?
Ansible | Puppet |
Easy agentless installation | Agent-based installation |
Based on Python | Based on Ruby |
Configuration files are written in YAML | Configuration files are written in DSL |
No support for Windows | Support for all popular OS’s |
We will now look at some DevOps interview questions on containerization.
Explain the architecture of Docker.
- Docker uses a client-server architecture.
- Docker Client is a service that runs a command. The command is translated using the REST API and is sent to the Docker Daemon (server).
- Docker Daemon accepts the request and interacts with the operating system to build Docker images and run Docker containers.
- A Docker image is a template of instructions, which is used to create containers.
- Docker container is an executable package of an application and its dependencies together.
- Docker registry is a service to host and distribute Docker images among users.

Advance DevOps Interview Question
What are the advantages of Docker over virtual machines?
Criteria | Virtual Machine | Docker |
Memory space | Occupies a lot of memory space | Docker containers occupy less space |
Boot-up time | Long boot-up time | Short boot-up time |
Performance | Running multiple virtual machines leads to unstable performance | Containers have a better performance, as they are hosted in a single Docker engine |
Scaling | Difficult to scale up | Easy to scale up |
Efficiency | Low efficiency | High efficiency |
Portability | Compatibility issues while porting across different platforms | Easily portable across different platforms |
Space allocation | Data volumes cannot be shared | Data volumes are shared and used again across multiple containers |
How do we share Docker containers with different nodes?

- It is possible to share Docker containers on different nodes with Docker Swarm.
- Docker Swarm is a tool that allows IT administrators and developers to create and manage a cluster of swarm nodes within the Docker platform.
- A swarm consists of two types of nodes: a manager node and a worker node
What are the commands used to create a Docker swarm?
- Create a swarm where you want to run your manager node.
Docker swarm init –advertise-addr <MANAGER-IP>
- Once you’ve created a swarm on your manager node, you can add worker nodes to your swarm.
- When a node is initialized as a manager, it immediately creates a token. In order to create a worker node, the following command (token) should be executed on the host machine of a worker node.
DevOps Interview Question
How do you run multiple containers using a single service?
- It is possible to run multiple containers as a single service with Docker Compose.
- Here, each container runs in isolation but can interact with each other.
- All Docker Compose files are YAML files.

What is a Docker file used for?
- A Docker file is used for creating Docker images using the build command.
- With a Docker image, any user can run the code to create Docker containers.
- Once a Docker image is built, it’s uploaded in a Docker registry.
- From the Docker registry, users can get the Docker image and build new containers whenever they want.

Explain the differences between Docker images and Docker containers.
Docker Images | Docker Container |
Docker images are templates of Docker containers | Containers are runtime instances of a Docker image |
An image is built using a Dockerfile | Containers are created using Docker images |
It is stored in a Docker repository or a Docker hub | They are stored in the Docker daemon |
The image layer is a read-only filesystem | Every container layer is a read-write filesystem |
Advance DevOps Interview Question
Instead of YAML, what can you use as an alternate file for building Docker compose?
To build a Docker compose, a user can use a JSON file instead of YAML. In case a user wants to use a JSON file, he/she should specify the filename as given:
Docker-compose -f Docker-compose.json up
How do you create a Docker container?
Task: Create a MySQL Docker container
A user can either build a Docker image or pull an existing Docker image (like MySQL) from Docker Hub.
Now, Docker creates a new container MySQL from the existing Docker image. Simultaneously, the container layer of the read-write filesystem is also created on top of the image layer.
- Command to create a Docker container: Docker run -t –i MySQL
- Command to list down the running containers: Docker ps
What is the difference between a registry and a repository?
Registry | Repository |
A Docker registry is an open-source server-side service used for hosting and distributing Docker images | The repository is a collection of multiple versions of Docker images |
In a registry, a user can distinguish between Docker images with their tag names | It is stored in a Docker registry |
Docker also has its own default registry called Docker Hub | It has two types: public and private repositories |
DevOps Interview Question
What are the cloud platforms that support Docker?
The following are the cloud platforms that Docker runs on:
- Amazon Web Services
- Microsoft Azure
- Google Cloud Platform
- Rackspace

What is the purpose of the expose and publish commands in Docker?
Expose
- Expose is an instruction used in Docker file.
- It is used to expose ports within a Docker network.
- It is a documenting instruction used at the time of building an image and running a container.
- Expose is the command used in Docker.
- Example: Expose 8080
Publish
- Publish is used in a Docker run command.
- It can be used outside a Docker environment.
- It is used to map a host port to a running container port.
- –publish or –p is the command used in Docker.
- Example: docker run –d –p 0.0.0.80:80
How does Nagios help in the continuous monitoring of systems, applications, and services?
Nagios enables server monitoring and the ability to check if they are sufficiently utilized or if any task failures need to be addressed.
- Verifies the status of the servers and services
- Inspects the health of your infrastructure
- Checks if applications are working correctly and web servers are reachable
Advance DevOps Interview Question
How does Nagios help in the continuous monitoring of systems, applications, and services?

What do you mean by Nagios Remote Plugin Executor (NPRE) of Nagios?
Nagios Remote Plugin Executor (NPRE) enables you to execute Nagios plugins on Linux/Unix machines. You can monitor remote machine metrics (disk usage, CPU load, etc.)
- The check_npre plugin that resides on the local monitoring machine
- The NPRE daemon that runs on the remote Linux/Unix machine
What are the port numbers that Nagios uses for monitoring purposes?
Usually, Nagios uses the following port numbers for monitoring:

DevOps Interview Question
What are active and passive checks in Nagios?
Nagios is capable of monitoring hosts and services in two ways:
Actively
- Active checks are initiated as a result of the Nagios process
- Active checks are regularly scheduled
Passively
- Passive checks are initiated and performed through external applications/processes
- Passive checks results are submitted to Nagios for processing
Active Checks:
- The check logic in the Nagios daemon initiates active checks.
- Nagios will execute a plugin and pass the information on what needs to be checked.
- The plugin will then check the operational state of the host or service, and report results back to the Nagios daemon.
- It will process the results of the host or service check and send notifications.

Passive Checks:
- In passive checks, an external application checks the status of a host or service.
- It writes the results of the check to the external command file.
- Nagios reads the external command file and places the results of all passive checks into a queue for later processing.
- Nagios may send out notifications, log alerts, etc. depending on the check result information.

Explain the main configuration file and its location in Nagios.
The main configuration file consists of several directives that affect how Nagios operates. The Nagios process and the CGIs read the config file.
A sample main configuration file will be placed into your settings directory:
/usr/local/Nagios/etc/resource.cfg
What is the Nagios Network Analyzer?
- It provides an in-depth look at all network traffic sources and security threats.
- It provides a central view of your network traffic and bandwidth data.
- It allows system admins to gather high-level information on the health of the network.
- It enables you to be proactive in resolving outages, abnormal behavior, and threats before they affect critical business processes.
Advance DevOps Interview Question
What are the benefits of HTTP and SSL certificate monitoring with Nagios?
HTTP certificate monitoring
- Increased server, services, and application availability.
- Fast detection of network outages and protocol failures.
- Enables web transaction and web server performance monitoring.
SSL certificate monitoring
- Increased website availability.
- Frequent application availability.
- It provides increased security.
Explain virtualization with Nagios.

Nagios can run on different virtualization platforms, like VMware, Microsoft Visual PC, Xen, Amazon EC2, etc.
- Provides the capabilities to monitor an assortment of metrics on different platforms
- Ensures quick detection of service and application failures
- Has the ability to monitor the following metrics:
- CPU Usage
- Memory
- Networking
- VM status
- Reduced administrative overhead
Name the three variables that affect recursion and inheritance in Nagios.
name – Template name that can be referenced in other object definitions so it can inherit the object’s properties/variables.
use – Here, you specify the name of the template object that you
want to inherit properties/variables from.
register – This variable indicates whether or not the object definition
should be registered with Nagios.
define someobjecttype{
object-specific variables ….
name template_name
use name_of_template
register [0/1]
}
DevOps Interview Question
Why is Nagios said to be object-oriented?

Using the object configuration format, you can create object definitions that inherit properties from other object definitions. Hence, Nagios is known as object-oriented.
Types of Objects:
- Services
- Hosts
- Commands
- Time Periods
Explain what state stalking is in Nagios.
- State stalking is used for logging purposes in Nagios.
- When stalking is enabled for a particular host or service, Nagios will watch that host or service very carefully.
- It will log any changes it sees in the output of check results.
- This helps in the analysis of log files.
What are the fundamental differences between DevOps & Agile?
The differences between the two are listed down in the table below.
Features | DevOps | Agile |
---|---|---|
Agility | Agility in both Development & Operations | Agility in only Development |
Processes/ Practices | Involves processes such as CI, CD, CT, etc. | Involves practices such as Agile Scrum, Agile Kanban, etc. |
Key Focus Area | Timeliness & quality have equal priority | Timeliness is the main priority |
Release Cycles/ Development Sprints | Smaller release cycles with immediate feedback | Smaller release cycles |
Source of Feedback | Feedback is from self (Monitoring tools) | Feedback is from customers |
Scope of Work | Agility & need for Automation | Agility only |
Advance DevOps Interview Question
What is the need for DevOps?
According to me, this answer should start by explaining the general market trend. Instead of releasing big sets of features, companies are trying to see if small features can be transported to their customers through a series of release trains. This has many advantages like quick feedback from customers, better quality of software etc. which in turn leads to high customer satisfaction. To achieve this, companies are required to:
Increase deployment frequency
Lower failure rate of new releases
Shortened lead time between fixes
Faster mean time to recovery in the event of new release crashing
DevOps fulfills all these requirements and helps in achieving seamless software delivery. You can give examples of companies like Etsy, Google and Amazon which have adopted DevOps to achieve levels of performance that were unthinkable even five years ago. They are doing tens, hundreds or even thousands of code deployments per day while delivering world class stability, reliability and security.
How is DevOps different from Agile / SDLC?
I would advise you to go with the below explanation:
Agile is a set of values and principles about how to produce i.e. develop software. Example: if you have some ideas and you want to turn those ideas into working software, you can use the Agile values and principles as a way to do that. But, that software might only be working on a developer’s laptop or in a test environment. You want a way to quickly, easily and repeatable move that software into production infrastructure, in a safe and simple way. To do that you need DevOps tools and techniques.
You can summarize by saying Agile software development methodology focuses on the development of software but DevOps on the other hand is responsible for development as well as deployment of the software in the safest and most reliable way possible. Here’s a blog that will give you more information on the evolution of DevOps.
Which are the top DevOps tools? Which tools have you worked on?
The most popular DevOps tools are mentioned below:
- Git : Version Control System tool
- Jenkins : Continuous Integration tool
- Selenium : Continuous Testing tool
- Puppet, Chef, Ansible : Configuration Management and Deployment tools
- Nagios : Continuous Monitoring tool
- Docker : Containerization tool
You can also mention any other tool if you want, but make sure you include the above tools in your answer.
The second part of the answer has two possibilities:
- If you have experience with all the above tools then you can say that I have worked on all these tools for developing good quality software and deploying those software’s easily, frequently, and reliably.
- If you have experience only with some of the above tools then mention those tools and say that I have specialization in these tools and have an overview about the rest of the tools.
DevOps Interview Question
How do all these tools work together?
Given below is a generic logical flow where everything gets automated for seamless delivery. However, this flow may vary from organization to organization as per the requirement.
- Developers develop the code and this source code is managed by Version Control System tools like Git etc.
- Developers send this code to the Git repository and any changes made in the code is committed to this Repository.
- Jenkins pulls this code from the repository using the Git plugin and build it using tools like Ant or Maven.
- Configuration management tools like puppet deploys & provisions testing environment and then Jenkins releases this code on the test environment on which testing is done using tools like selenium.
- Once the code is tested, Jenkins send it for deployment on the production server (even production server is provisioned & maintained by tools like puppet).
- After deployment It is continuously monitored by tools like Nagios.
- Docker containers provides testing environment to test the build features.

What are the advantages of DevOps?
Technical benefits:
- Continuous software delivery
- Less complex problems to fix
- Faster resolution of problems
Business benefits:
- Faster delivery of features
- More stable operating environments
- More time available to add value (rather than fix/maintain)
What is the most important thing DevOps helps us achieve?
According to me, the most important thing that DevOps helps us achieve is to get the changes into production as quickly as possible while minimizing risks in software quality assurance and compliance. This is the primary objective of DevOps. Learn more in this DevOps tutorial blog.
However, you can add many other positive effects of DevOps. For example, clearer communication and better working relationships between teams i.e. both the Ops team and Dev team collaborate together to deliver good quality software which in turn leads to higher customer satisfaction.
Advance DevOps Interview Question
Explain with a use case where DevOps can be used in industry/ real-life.
There are many industries that are using DevOps so you can mention any of those use cases, you can also refer the below example:
Etsy is a peer-to-peer e-commerce website focused on handmade or vintage items and supplies, as well as unique factory-manufactured items. Etsy struggled with slow, painful site updates that frequently caused the site to go down. It affected sales for millions of Etsy’s users who sold goods through online market place and risked driving them to the competitor.
With the help of a new technical management team, Etsy transitioned from its waterfall model, which produced four-hour full-site deployments twice weekly, to a more agile approach. Today, it has a fully automated deployment pipeline, and its continuous delivery practices have reportedly resulted in more than 50 deployments a day with fewer disruptions.
Explain your understanding and expertise on both the software development side and the technical operations side of an organization you have worked with in the past.
DevOps engineers almost always work in a 24/7 business-critical online environment. I was adaptable to on-call duties and was available to take up real-time, live-system responsibility. I successfully automated processes to support continuous software deployments. I have experience with public/private clouds, tools like Chef or Puppet, scripting and automation with tools like Python and PHP, and a background in Agile.
What are the anti-patterns of DevOps?
A pattern is common usage usually followed. If a pattern commonly adopted by others does not work for your organization and you continue to blindly follow it, you are essentially adopting an anti-pattern. There are myths about DevOps. Some of them include:
- DevOps is a process
- Agile equals DevOps?
- We need a separate DevOps group
- Devops will solve all our problems
- DevOps means Developers Managing Production
- DevOps is Development-driven release management
- DevOps is not development driven.
- DevOps is not IT Operations driven.
- We can’t do DevOps – We’re Unique
- We can’t do DevOps – We’ve got the wrong people
DevOps Interview Question
What is Version control?
Version control allows you to:
- Revert files back to a previous state.
- Revert the entire project back to a previous state.
- Compare changes over time.
- See who last modified something that might be causing a problem.
- Who introduced an issue and when.
What are the benefits of using version control?
I will suggest you to include the following advantages of version control:
- With Version Control System (VCS), all the team members are allowed to work freely on any file at any time. VCS will later allow you to merge all the changes into a common version.
- All the past versions and variants are neatly packed up inside the VCS. When you need it, you can request any version at any time and you’ll have a snapshot of the complete project right at hand.
- Every time you save a new version of your project, your VCS requires you to provide a short description of what was changed. Additionally, you can see what exactly was changed in the file’s content. This allows you to know who has made what change in the project.
- A distributed VCS like Git allows all the team members to have complete history of the project so if there is a breakdown in the central server you can use any of your teammate’s local Git repository.
What are the principles of DevOps?
The principles behind DevOps are:
- Continuous deployment
- Infrastructure as code
- Automation
- Monitoring
- Security
Advance DevOps Interview Question
How DevOps is helpful to developers?
DevOps is very helpful for developers to fix the bugs and quickly implement the new features. It also helps in more transparent communication between the team members.