DevOps Interview by DK
DevOps Interview by DK
Interview Guide
DevOps is one of the hottest competitive, and the questions asked
buzzwords in tech now, although in a DevOps engineer interview can
it is much more than buzz. It cover a lot of challenging subjects.
is a collaboration between the If you’ve started to prepare for
development and operations team, development and operations roles
where they work together to deliver in the IT industry, you know it’s a
a product faster and efficiently. In challenging field that will take some
the past few years, there has been a real preparation to break into. Here are
tremendous increase in job listings some of the most common DevOps
for DevOps engineers. Multinational interview questions and answers that
companies, like Google, Facebook, can help you while you prepare for
and Amazon, frequently have multiple DevOps roles in the industry.
open positions for DevOps engineers.
However, the job market is highly
2 | www.simplilearn.com
Interview Guide
Topics
Covered
3 | www.simplilearn.com
Interview Guide
General DevOps
Interview Questions
1. What do you know about DevOps?
4 | www.simplilearn.com
Interview Guide
1. Selenium
2. Puppet
3. Chef
4. Git
5. Jenkins
6. Ansible
7. Docker
Plan - Initially, there should be a plan for the type of application that needs to
be developed. Getting a rough picture of the development process is always a
good idea.
5 | www.simplilearn.com
Interview Guide
Test - This is the most crucial step of the application development. Test the
application and rebuild, if necessary.
Integrate - Multiple codes from different programmers are integrated into one.
Technical benefits
Business benefits
6 | www.simplilearn.com
Interview Guide
7 | www.simplilearn.com
Interview Guide
8 | www.simplilearn.com
Interview Guide
Ensures that all services, applications, and resources are running on the servers
properly.
Built for scale - You can manage a single instance or scale to thousands using
AWS services.
Automation - AWS lets you automate tasks and processes, giving you more
time to innovate
Secure - Using AWS Identity and Access Management (IAM), you can set user
permissions and policies.
9 | www.simplilearn.com
Interview Guide
Meantime to failure recovery - This is the average time taken to recover from a
failure.
Ensuring all your servers and other infrastructure components are provisioned
consistently and effortlessly.
Administering cloud computing environments, also known as infrastructure as
a service (IaaS).
14. Why Has DevOps Gained Prominence over the Last Few Years?
Before talking about the growing popularity of DevOps, discuss the current
industry scenario. Begin with some examples of how big players such as
Netflix and Facebook are investing in DevOps to automate and accelerate
application deployment and how this has helped them grow their business.
Using Facebook as an example, you would point to Facebook’s continuous
deployment and code ownership models and how these have helped it scale
up but ensure the quality of experience at the same time. Hundreds of lines of
code are implemented without affecting quality, stability, and security.
10 | www.simplilearn.com
Interview Guide
Your next use case should be Netflix. This streaming and on-demand video
company follow similar practices with fully automated processes and systems.
Mention the user base of these two organizations: Facebook has 2 billion users
while Netflix streams online content to more than 100 million users worldwide.
These are great examples of how DevOps can help organizations to ensure
higher success rates for releases, reduce the lead time between bug fixes,
streamline and continuous delivery through automation, and an overall
reduction in manpower costs.
♦ If the central server crashes, all data from the project will be lost
11 | www.simplilearn.com
Interview Guide
♦ Every developer has a copy of all versions of the code on their systems
♦ Enables team members to work offline and does not rely on a single location
for backups
16. What is the git command that downloads any repository from
GitHub to your computer?
The git command that downloads any repository from GitHub to your
computer is git clone.
17. How do you push a file from your local system to the GitHub
repository using Git?
12 | www.simplilearn.com
Interview Guide
• It does not contain any working or checked out a copy of source files
• Bare repositories store git revision history in the root folder of your repository,
instead of the .git subfolder
2. git mv
3. git rm -r
13 | www.simplilearn.com
Interview Guide
20. What is the process for reverting a commit that has already been
pushed and made public?
There are two ways that you can revert a commit:
1. Remove or fix the bad file in a new commit and push it to the remote
repository. Then commit it to the remote repository using:
git commit –m "commit message"
2. Create a new commit that undoes all the changes that were made in the bad
commit. Use the following command:
git revert <commit id>
Example: git revert 56de0938f
21. Explain the difference between git fetch and git pull.
Git fetch Git pull
14 | www.simplilearn.com
Interview Guide
• The circles on the branch represent various commits made on the branch
• After you are done with all the changes, you can merge it with the master
branch
24. What is the difference between Git Merge and Git Rebase?
Suppose you are working on a new feature in a dedicated branch, and another
team member updates the master branch with new commits. You can use
these two functions:
Git Merge
To incorporate the new commits into your feature branch, use Git merge.
♦ Creates an extra merge commit every time you need to incorporate
changes
♦ But, it pollutes your feature branch history
15 | www.simplilearn.com
Interview Guide
Git Rebase
As an alternative to merging, you can rebase the feature branch on to master.
♦ Incorporates all the new commits in the master branch
♦ It creates new commits for every commit in the original branch and rewrites
project history
25. How do you find a list of files that have been changed in a
particular commit?
The command to get a list of files that have been changed in a particular commit
is:
• commit hash will list all the files that were changed or added in that commit
16 | www.simplilearn.com
Interview Guide
Manually edit the conflicted file to select the changes that you want to keep in
the final merge.
This is done when a merge conflict is caused after competing for line changes. For
example, this may occur when people make different changes to the same line of
the same file on different branches in your Git repository.
• In the "Pull requests" drop-down, click the pull request with a merge conflict
that you'd like to resolve
• Decide if you only want to keep your branch's changes, the other branch's
changes, or make a brand new change, which may incorporate changes from
both branches.
• Delete the conflict markers <<<<<<<, =======, >>>>>>> and make changes
you want in the final merge.
17 | www.simplilearn.com
Interview Guide
• If you have more than one merge conflict in your file, scroll down to the next
set of conflict markers and repeat steps four and five to resolve your merge
conflict.
• Once you have resolved all the conflicts in the file, click Mark as resolved.
• If you have more than one file with a conflict, select the next file you want
to edit on the left side of the page under "conflicting files" and repeat steps
four to seven until you've resolved all of your pull request's merge conflicts.
18 | www.simplilearn.com
Interview Guide
• Navigate into the local Git repository that contains the merge conflict.
• Generate a list of the files that the merge conflict affects. In this example,
the file styleguide.md has a merge conflict.
• Open any text editor, such as Sublime Text or Atom, and navigate to the file
that has merge conflicts.
• To see the beginning of the merge conflict in your file, search the file for
the conflict marker "<<<<<<<. " Open it, and you'll see the changes from the
base branch after the line "<<<<<<< HEAD."
• Next, you'll see "=======", which divides your changes from the changes in
the other branch, followed by ">>>>>>> BRANCH-NAME".
19 | www.simplilearn.com
Interview Guide
• Decide if you only want to keep your branch's changes, the other branch's
changes, or make a brand new change, which may incorporate changes
from both branches.
• Delete the conflict markers "<<<<<<<", "=======", ">>>>>>>" and make the
changes you want in the final merge.
• In this example, both the changes are incorporated into the final merge:
• Now you can merge the branches on the command line, or push your
changes to your remote repository on GitHub and merge your changes in a
pull request.
20 | www.simplilearn.com
Interview Guide
♦ Jenkins master pulls the code from the remote GitHub repository every
time there is a code commit.
♦ On request from the Jenkins master, the slaves carry out, builds, test, and
produce test reports.
♦ There is a single source of truth for the pipeline, which can be viewed and
edited.
21 | www.simplilearn.com
Interview Guide
♦ Step: A single task that tells Jenkins what to do at a particular point in time
2. pom.xml
3. dependency.xml
4. Version.xml
32. Explain the two types of pipeline in Jenkins, along with their
syntax .
Jenkins provides two ways of developing a pipeline code: Scripted and
Declarative.
22 | www.simplilearn.com
Interview Guide
Syntax:
It providesPipeline:
B. Declarative a simple and friendly syntax to define a pipeline. Here, the
pipeline block defines the work done throughout the pipeline.
Syntax:
23 | www.simplilearn.com
Interview Guide
24 | www.simplilearn.com
Interview Guide
34. How can you copy Jenkins from one server to another?
♦ Move the job from one Jenkins installation to another by copying the
corresponding job directory.
♦ Jenkins can use the Lightweight Directory Access Protocol (LDAP) server
to authenticate users.
Jenkins can be configured to employ the authentication mechanism that
♦
the deployed application server uses.
25 | www.simplilearn.com
Interview Guide
37. How can you temporarily turn off Jenkins security if the
administrative users have locked themselves out of the admin
console?
♦ When security is enabled, the Config file contains an XML element named
useSecurity that will be set to true.
♦ By changing this setting to false, security will be disabled the next time
Jenkins is restarted.
39. What are the commands that you can use to restart Jenkins
manually?
Two ways to manually restart Jenkins:
26 | www.simplilearn.com
Interview Guide
Selenium WebDriver
Selenium Grid
• Works with Selenium RC and runs tests on different nodes using browsers.
27 | www.simplilearn.com
Interview Guide
43. What are the different test types that Selenium supports?
♦ Functional - This is a type of black-box testing in which the test cases are
based on the software specification.
♦ Regression - This testing helps to find new errors, regressions, etc. in
different functional and non-functional areas of code after the alteration.
♦ Load Testing - This testing seeks to monitor the response of a device after
putting a load on it. It is carried out to study the behavior of the system
under certain conditions.
Verification of messages
• Labels
• Errors displayed on the web page
Syntax:
String Text=driver.findElement(By.id(“text”)).getText();
28 | www.simplilearn.com
Interview Guide
Method Description
It finds the first element in the current web page that matches the specified
locator value.
Syntax:
WebElement element=driver.findElements(By.xpath(“//div[@id=‘example’]//
ul//li”));
B. findElements()
It finds all the elements in the current web page that matches the specified
locator value.
Sy ntax:
List elementList=driver.findElements(By.xpath(“//div[@id=‘example’]//ul//li”));
29 | www.simplilearn.com
Interview Guide
30 | www.simplilearn.com
Interview Guide
$ knife chef-client
31 | www.simplilearn.com
Interview Guide
32 | www.simplilearn.com
Interview Guide
33 | www.simplilearn.com
Interview Guide
This also ensures that Ansible doesn't recognize the line as a dictionary
declaration.
♦ Roles are used to manage tasks in a playbook. They can be easily shared
via Ansible Galaxy.
Configuration files are written in YAML Configuration files are written in DSL
34 | www.simplilearn.com
Interview Guide
♦ 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.
35 | www.simplilearn.com
Interview Guide
Memory space Occupies a lot of memory space Docker containers occupy less space
Portability Compatibility issues while porting Easily portable across di erent platforms
across di erent platforms
36 | www.simplilearn.com
Interview Guide
• Aswarm consists of two types of nodes: a manager node and worker node.
• Once you've created a swarm on your manager node, you can add worker
nodes to your swarm.
• Here, each container runs in isolation but can interact with each other.
37 | www.simplilearn.com
Interview Guide
• With a Docker image, any user can run the code to create Docker
containers.
• From the Docker registry, users can get the Docker image and build new
containers whenever they want.
69. 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
38 | www.simplilearn.com
Interview Guide
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.
Docker also has its own default registry It has two types: public and private
called Docker Hub repositories
39 | www.simplilearn.com
Interview Guide
Pu bli s h
40 | www.simplilearn.com
Interview Guide
77. What are the port numbers that Nagios uses for monitoring
purposes?
Usually, Nagios uses the following port numbers for monitoring:
41 | www.simplilearn.com
Interview Guide
Passively
• 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.
42 | www.simplilearn.com
Interview Guide
Passive Checks:
• 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.
80. 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
43 | www.simplilearn.com
Interview Guide
82. 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.
44 | www.simplilearn.com
Interview Guide
Nagios can run on different virtualization platforms, like VMware, Microsoft Visual
PC, Xen, Amazon EC2, etc.
84. Name the three variables that affect recursion and inheritance in
N agios .
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
define someobjecttype{
object-specific variables ….
name template_name
use name_of_template
register [0/1]
45 | www.simplilearn.com
Interview Guide
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
As you can see, there is a lot to learn to be able to land a rewarding job in the field of
DevOps—Git, Jenkins, Selenium, Chef, Puppet, Ansible, Docker, Nagios, and more. While
this comprehensive interview question guide is designed to help you ace your next
interview, you would undoubtedly perform better if you enroll in our comprehensive
DevOps Engineer Training Course today!
46 | www.simplilearn.com
Interview Guide
INDIA USA
Simplilearn Solutions Pvt Ltd. Simplilearn Americas, Inc.
# 53/1 C, Manoj Arcade, 24th Main, 201 Spear Street, Suite 1100,
Harlkunte San Francisco, CA 94105
2nd Sector, HSR Layout United States
Bangalore: 560102 Phone No: +1-844-532-7688
Call us at: 1800-212-7688
www.simplilearn.com
47 | www.simplilearn.com