DevOps Interview Question Part 2

Which of the following commands would you use to stop or disable the ‘httpd’ service when the system boots?

  1. # systemctl disable httpd.service
  2. # system disable httpd.service
  3. # system disable httpd
  4. # 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


    # puppetca –sign ChefAgent

    # puppetca sign hostname-of-agent


    # puppetca sign ChefAgent
  • For Puppet version 2.7:

    # puppetca –sign hostname-of-agent


    # puppetca –sign ChefAgent

    # puppetca sign hostname-of-agent


    # 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’) {


‘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?

Easy agentless installationAgent-based installation
Based on PythonBased on Ruby
Configuration files are written in YAMLConfiguration files are written in DSL
No support for WindowsSupport 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?

CriteriaVirtual Machine Docker
Memory spaceOccupies a lot of memory spaceDocker containers occupy less space
Boot-up timeLong boot-up timeShort boot-up time
PerformanceRunning multiple virtual machines leads to unstable performance Containers have a better performance, as they are hosted in a single Docker engine
ScalingDifficult to scale upEasy to scale up
EfficiencyLow efficiencyHigh efficiency
PortabilityCompatibility issues while porting across different platformsEasily portable across different platforms
Space allocationData volumes cannot be sharedData 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 containersContainers are runtime instances of a Docker image
An image is built using a DockerfileContainers are created using Docker images
It is stored in a Docker repository or a Docker hubThey are stored in the Docker daemon
The image layer is a read-only filesystemEvery 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?

A Docker registry is an open-source server-side service used for hosting and distributing Docker imagesThe repository is a collection of multiple versions of Docker images 
In a registry, a user can distinguish between Docker images with their tag namesIt is stored in a Docker registry 
Docker also has its own default registry called Docker HubIt 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 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 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

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:

Nagios Use

DevOps Interview Question

What are active and passive checks in Nagios?

Nagios is capable of monitoring hosts and services in two ways:


  • Active checks are initiated as a result of the Nagios process
  • Active checks are regularly scheduled


  • 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.
Nagios Process

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.
Nagios Process

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:


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?

Nagios Object

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.

AgilityAgility in both Development & OperationsAgility in only Development
Processes/ PracticesInvolves processes such as CI, CD, CT, etc.Involves practices such as Agile Scrum, Agile Kanban, etc.
Key Focus AreaTimeliness & quality have equal priorityTimeliness is the main priority
Release Cycles/ Development SprintsSmaller release cycles with immediate feedbackSmaller release cycles
Source of FeedbackFeedback is from self (Monitoring tools)Feedback is from customers
Scope of WorkAgility & need for AutomationAgility 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:

  1. 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.
  2. 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.

  1. Developers develop the code and this source code is managed by Version Control System tools like Git etc.
  2. Developers send this code to the Git repository and any changes made in the code is committed to this Repository.
  3. Jenkins pulls this code from the repository using the Git plugin and build it using tools like Ant or Maven.
  4. 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.
  5. Once the code is tested, Jenkins send it for deployment on the production server (even production server is provisioned & maintained by tools like puppet).
  6. After deployment It is continuously monitored by tools like Nagios.
  7. Docker containers provides testing environment to test the build features.
devops tools - devops interview questions

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
    1. DevOps is not development driven.
    2. 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.

DevOps Part 1DevOps Part 3

Leave a Comment

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

Back to top