Dev Ops Interview Questions
Dev Ops Interview Questions
This way of practice is related to agile methodology and it mainly focuses on team
communication, resource management, and teamwork. The main benefits of following
this structure are the speed of development and resolving the issues at the
production environment level, the stability of applications, and the innovation
involved behind it.
DevOps
DevOps Tools
DevOps is a methodology aimed at increased productivity and quality of product
development. The main tools used in this methodology are:
DevOps Tools
Organizations that have adopted this methodology are reportedly accomplishing
almost thousands of deployments in a single day thereby providing increased
reliability, stability, and security with increased customer satisfaction.
Customer satisfaction is now a motto to the organizations which has also become the
goal of any product for its success. In order to achieve this, companies need to do
the below things:
SSH is a secured encrypted version of the previously known Telnet which was
unencrypted and not secure. This ensured that the communication with the remote
server occurs in an encrypted form.
SSH also has a mechanism for remote user authentication, input communication
between the client and the host, and sending the output back to the client.
The following diagram gives a brief idea about what CM is all about:
It also helps in bringing consistency and improving the product development process
by employing means of design streamlining, extensive documentation, control, and
change implementation during various phases/releases of the project.
Developers regularly check out code into their local workspaces and work on the
features assigned to them.
Once they are done working on it, the code is committed and pushed to the remote
shared repository which is handled by making use of effective version control tools
like git.
The CI server keeps track of the changes done to the shared repository and it pulls
the changes as soon as it detects them.
The CI server then triggers the build of the code and runs unit and integration
test cases if set up.
The team is informed of the build results. In case of the build failure, the team
has to work on fixing the issue as early as possible, and then the process repeats.
8. Why is Continuous Integration needed?
By incorporating Continuous Integration for both development and testing, it has
been found that the software quality has improved and the time taken for delivering
the features of the software has drastically reduced.
This also allows the development team to detect and fix errors at the initial stage
as each and every commit to the shared repository is built automatically and run
against the unit and integration test cases.
Using this phase will help the team to test each build continuously (as soon as the
code developed is pushed) thereby giving the dev teams a chance to get instant
feedback on their work and ensuring that these problems don’t arrive in the later
stages of SDLC cycle.
Doing this would drastically speed up the workflow followed by the developer to
develop the project due to the lack of manual intervention steps to rebuild the
project and run the automated test cases every time the changes are made.
Planning:
Tools like Google Apps, Asana, Microsoft teams, etc are used for this purpose.
Development:
The planning phase is followed by the Development phase where the project is built
by developing system infrastructure, developing features by writing codes, and then
defining test cases and the automation process. Developers store their codes in a
code manager called remote repository which aids in team collaboration by allowing
view, modification, and versioning of the code.
Tools like git, IDEs like the eclipse, IntelliJ, and technological stacks like
Node, Java, etc are used.
This phase allows for automation of code validation, build, and testing. This
ensures that the changes are made properly without development environment errors
and also allows the identification of errors at an initial stage.
Deployment:
DevOps aids in the deployment automation process by making use of tools and scripts
which has the final goal of automating the process by means of feature activation.
Here, cloud services can be used as a force that assists in upgrade from finite
infrastructure management to cost-optimized management with the potential to
infinite resources.
Tools like Microsoft Azure, Amazon Web Services, Heroku, etc are used.
Operations:
This phase usually occurs throughout the lifecycle of the product/software due to
the dynamic infrastructural changes. This provides the team with opportunities for
increasing the availability, scalability, and effective transformation of the
product.
Tools like Loggly, BlueJeans, Appdynamics, etc are used commonly in this phase.
Monitoring:
DevOps tries to reduce the gap between the developers and the operations team for
the effective launch of the product.
Agile Methodology
13. Differentiate between Continuous Deployment and Continuous Delivery?
The main difference between Continuous Deployment and Continuous Delivery are given
below:
Continuous Deployment Continuous Delivery
The deployment to the production environment is fully automated and does not
require manual/ human intervention. In this process, some amount of manual
intervention with the manager’s approval is needed for deployment to a production
environment.
Here, the application is run by following the automated set of instructions, and no
approvals are needed. Here, the working of the application depends on the
decision of the team.
In case of failure, the data is lost as it is neither a persistent data store nor a
database.
It is not an application-specific cache.
Large objects cannot be cached.
16. What are the various branching strategies used in the version control system?
Branching is a very important concept in version control systems like git which
facilitates team collaboration. Some of the most commonly used branching types are:
Feature branching
Here, each task is maintained in its own branch with the task key being the branch
name.
Naming the branch name as a task name makes it easy to identify what task is
getting covered in what branch.
Release branching
This type of branching is done once a set of features meant for a release are
completed, they can be cloned into a branch called the release branch. Any further
features will not be added to this branch.
Only bug fixes, documentation, and release-related activities are done in a release
branch.
Once the things are ready, the releases get merged into the main branch and are
tagged with the release version number.
These changes also need to be pushed into the develop branch which would have
progressed with new feature development.
The branching strategies followed would vary from company to company based on their
requirements and strategies.
17. Can you list down certain KPIs which are used for gauging the success of
DevOps?
KPIs stands for Key Performance Indicators. Some of the popular KPIs used for
gauging the success of DevOps are:
20. Can you differentiate between continuous testing and automation testing?
The difference between continuous testing and automation testing is given below:
Controlling machines
Nodes
For this to work, Ansible is installed on controlling machine using which the nodes
are managed by means of using SSH. The location of the nodes would be specified and
configured in the inventories of the controlling machine.
Ansible does not require any installations on the remote node servers due its
nature of being agentless. Hence, no background process needs to be executed while
managing any remote nodes.
Ansible can manage lots of nodes from a single controlling system my making use of
Ansible Playbooks through SSH connection. Playbooks are of the YAML format and are
capable to perform multiple tasks.
Stage 1: Plan: Plan and come up with a roadmap for implementation by performing a
thorough assessment of the already existing processes to identify the areas of
improvement and the blindspots.
Stage 2: PoC: Come up with a proof of concept (PoC) just to get an idea regarding
the complexities involved. Once the PoC is approved, the actual implementation work
of the project would start.
Stage 3: Follow DevOps: Once the project is ready for implementation, actual DevOps
culture could be followed by making use of its phases like version control,
continuous integration, continuous testing, continuous deployment, continuous
delivery, and continuous monitoring.
DevOps Interview Questions For Experienced
26. Can you explain the “Shift left to reduce failure” concept in DevOps?
In order to understand what this means, we first need to know how the traditional
SDLC cycle works. In the traditional cycle, there are 2 main sides -
The left side of the cycle consists of the planning, design, and development phase
The right side of the cycle includes stress testing, production staging, and user
acceptance.
In DevOps, shifting left simply means taking up as many tasks that usually take
place at the end of the application development process as possible into the
earlier stages of application development. From the below graph, we can see that if
the shift left operations are followed, the chances of errors faced during the
later stages of application development would greatly reduce as it would have been
identified and solved in the earlier stages itself.
Work side by side with the development team while creating the deployment and test
case automation. This is the first and the obvious step in achieving shift left.
This is done because of the well-known fact that the failures that get notices in
the production environment are not seen earlier quite often. These failures can be
linked directly to:
Different deployment procedures used by the development team while developing their
features.
Production deployment procedures sometimes tend to be way different than the
development procedure. There can be differences in tooling and sometimes the
process might also be manual.
Both the dev team and the operations teams are expected to take ownership to
develop and maintain standard procedures for deployment by making use of the cloud
and the pattern capabilities. This aids in giving the confidence that the
production deployments would be successful.
Usage of pattern capabilities to avoid configurational level inconsistencies in the
different environments being used. This would require the dev team and the
operation team to come together and work in developing a standard process that
guides developers to test their application in the development environment in the
same way as they test in the production environment.
27. Do you know about post mortem meetings in DevOps?
Post Mortem meetings are those that are arranged to discuss if certain things go
wrong while implementing the DevOps methodology. When this meeting is conducted, it
is expected that the team has to arrive at steps that need to be taken in order to
avoid the failure(s) in the future.
Jenkins also uses multiple slaves because there might be chances that require
different test case suites to be run for different environments once the code
commits are done.
Jenkins Architecture
30. Can you explain the “infrastructure as code” (IaC) concept?
As the name indicates, IaC mainly relies on perceiving infrastructure in the same
way as any code which is why it is commonly referred to as “programmable
infrastructure”. It simply provides means to define and manage the IT
infrastructure by using configuration files.
This concept came into prominence because of the limitations associated with the
traditional way of managing the infrastructure. Traditionally, the infrastructure
was managed manually and the dedicated people had to set up the servers physically.
Only after this step was done, the application would have been deployed. Manual
configuration and setup were constantly prone to human errors and inconsistencies.
This also involved increased cost in hiring and managing multiple people ranging
from network engineers to hardware technicians to manage the infrastructural tasks.
The major problem with the traditional approach was decreased scalability and
application availability which impacted the speed of request processing. Manual
configurations were also time-consuming and in case the application had a sudden
spike in user usage, the administrators would desperately work on keeping the
system available for a large load. This would impact the application availability.
IaC solved all the above problems. IaC can be implemented in 2 approaches:
The blue environment would indicate the old version of the application whereas the
green environment would be the new version.
The production traffic would be moved gradually from blue to green environment and
once it is fully transferred, the blue environment is kept on hold just in case of
rollback necessity.
In this pattern, the team has to ensure two identical prod environments but only
one of them would be LIVE at a given point of time. Since the blue environment is
more steady, the LIVE one is usually the blue environment.
34. What are the steps to be undertaken to configure git repository so that it runs
the code sanity checking tooks before any commits? How do you prevent it from
happening again if the sanity testing fails?
Sanity testing, also known as smoke testing, is a process used to determine if it’s
reasonable to proceed to test.
Git repository provides a hook called pre-commit which gets triggered right before
a commit happens. A simple script by making use of this hook can be written to
achieve the smoke test.
The script can be used to run other tools like linters and perform sanity checks on
the changes that would be committed into the repository.
#!/bin/sh
files=$(git diff –cached –name-only –diff-filter=ACM | grep ‘.py$’)
if [ -z files ]; then
exit 0
fi
unfmtd=$(pyfmt -l $files)
if [ -z unfmtd ]; then
exit 0
fi
echo “Some .py files are not properly fmt’d”
exit 1
The above script checks if any .py files which are to be committed are properly
formatted by making use of the python formatting tool pyfmt. If the files are not
properly formatted, then the script prevents the changes to be committed to the
repository by exiting with status 1.
35. How can you ensure a script runs every time repository gets new commits through
git push?
There are three means of setting up a script on the destination repository to get
executed depending on when the script has to be triggered exactly. These means are
called hooks and they are of three types:
Pre-receive hook: This hook is invoked before the references are updated when
commits are being pushed. This hook is useful in ensuring the scripts related to
enforcing development policies are run.
Update hook: This hook triggers the script to run before any updates are actually
made. This hook is called once for every commit which has been pushed to the
repository.
Post-receive hook: This hook helps trigger the script after the updates or changes
have been accepted by the destination repository. This hook is ideal for
configuring deployment scripts, any continuous integration-based scripts or email
notifications process to the team, etc.
Conclusion
DevOps is a culture-shifting practice that has and is continuing to help lots of
businesses and organizations in a tremendous manner. It helps in bridging the gap
between the conflict of goals and priorities of the developers (constant need for
change) and the operations (constant resistance to change) team by creating a
smooth path for Continuous Development and Continuous Integration. Being a DevOps
engineer has huge benefits due to the ever-increasing demand for DevOps practice.
Additional Resources
Practice Coding
DevOps Tools
DevOps Engineer Salary
Dev Ops MCQs
1.
DevOps best represents what among the following options?
To establish an environment where the release of applications has more value than
its quality
To determine an environment where an application is developed so that it performs
all operation tasks
Agile
Waterfall
eXtreme Programming
Lean
4.
What is the role of the Change Management unit in a DevOps environment?
Whenever an app change is needed, the change request goes to the developers for
authorization. Only if the request is authorised, the operations team begins
implementation.
Agile accounts for the change of thinking whereas DevOps accounts for cultural
change of an organization.
Because development teams have the upper hand in knowing about software and
services.
Because operation teams have the upper hand in knowing about various environments.
Because both the teams have conflicting business priorities and goals.
7.
Choose the best technique for converting normal changes to standard changes.
remove
rmdir
rm
rdir
9.
What is Bi-Modal IT?
Option a and c
10.
Which of the following elements does not contribute to the value stream of an
organization directly if it employs DevOps culture?
DevOps Engineer
Clients