Devops: Interview Guide
Devops: Interview Guide
Devops: Interview Guide
DevOps
Interview Guide
1 | www.simplilearn.com
Ace Your DevOps
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?
A: Your answer must be simple and straightforward. Begin by explaining the
growing importance of DevOps in the IT industry. Discuss how such an
approach aims to synergize the efforts of the development and operations
teams to accelerate the delivery of software products, with a minimal failure
rate. Include how DevOps is a value-added practice, where development and
operations engineers join hands throughout the product or service lifecycle,
right from the design stage to the point of deployment.
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
Stage 1
An assessment of the existing process and implementation for about two to
three weeks to identify areas of improvement so that the team can create a
road map for the implementation.
Stage 2
Create a proof of concept (PoC). Once it is accepted and approved, the team
can start on the actual implementation and roll-out of the project plan.
Stage 3
The project is now ready for implementing DevOps by using version control/
integration/testing/deployment/delivery and monitoring followed step by step.
• E
nsures code can be safely • E
very change that passes the
deployed automated tests is deployed to
on to production production automatically
• E
nsures business applications • M
akes software development
and and the release process faster
services function as expected and more robust
• D
elivers every change to a • T
here is no explicit approval
production-like from a developer and requires a
environment through rigorous developed culture of monitoring
automated testing
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.
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
• B
are 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
• G
it fetch only downloads new
data from a remote repository
• D
oes not integrate any new • G
it pull updates the current HEAD
data into your working files branch with the latest changes
from the remote server
• U
sers can run a Git fetch at any
time to update the remote-tracking • D
ownloads new data and integrate
branches it with the current working files
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.
his is done when a merge conflict is caused after competing for line changes. For
T
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.
• Once you've resolved your merge conflicts, click Commit merge. This
merges the entire base branch into your head branch.
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
♦ S
tage: Defines a conceptually distinct subset of tasks performed through
the entire pipeline (build, test, deploy stages)
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:
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.
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.
44. How can you access the text of a web element?
Get command is used to retrieve the text of a specified web element. The
command does not return any parameter but returns a string value.
Used for:
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
clickAndHold()
Clicks without releasing the current mouse
location
dragAndDrop()
Performs click-and-hold at the location of the source
element
keyDown(modifier_key)
Performs a modifier key press (ctrl, shift, Fn, etc.)
keyUp(modifier_key)
Performs a key release
29 | www.simplilearn.com
Interview Guide
30 | www.simplilearn.com
Interview Guide
31 | www.simplilearn.com
Interview Guide
Example:
Example:
Example:
Example:
32 | www.simplilearn.com
Interview Guide
For example:
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
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 different platforms
across different platforms
Space Data volumes cannot be shared Data volumes are shared and used
allocation again across multiple containers
36 | www.simplilearn.com
Interview Guide
• D
ocker 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 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
Publish
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
Actively
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.
SSL certificate monitoring
• Increased website availability.
• Frequent application availability.
• It provides increased security.
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
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
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