Google News
DevOps Interview Questions
The DevOps is a combination of two words one is software Development, and second is Operations. It allows a single team to handle the entire application lifecycle, from development to testing, deployment, and operations. DevOps helps you to reduce the disconnection between software developers, quality assurance (QA) engineers, and system administrators.

Characteristics DevOps
Basic premise A collaboration of development and operations teams. It is more of a cultural shift.
Related to Agile methodology
Priorities Resource management, communication, and teamwork
Benefits Speed, functionality, stability, and innovation
A DevOps engineer is a person who works with both software developers and the IT staff to ensure smooth code releases. They are generally developers who develop an interest in the deployment and operations domain or the system admins who develop a passion for coding to move towards the development side.
In short, a DevOps engineer is someone who has an understanding of SDLC (Software Development Lifecycle) and of automation tools for developing CI/CD pipelines.
These days, the market window of products has reduced drastically. We see new products almost daily. This provides a myriad of choices to consumers but it comes at a cost of heavy competition in the market. Organizations cant afford to release big features after a gap. They tend to ship off small features as releases to the customers at regular intervals so that their products don't get lost in this sea of competition.
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 :
* Frequent feature deployments
* Reduce time between bug fixes
* Reduce failure rate of releases
* Quicker recovery time in case of release failures.
* In order to achieve the above points and thereby achieving seamless product delivery, DevOps culture acts as a very useful tool. Due to these advantages, multi-national companies like Amazon and Google have adopted the methodology which has resulted in their increased performance.
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
The principles behind DevOps are :
* Continuous deployment
* Infrastructure as code
* Automation
* Monitoring
* Security
Here are some popular tools of DevOps, such as :
Jenkins : Jenkins is a DevOps tool for monitoring the execution of repeated tasks. Jenkins is a software that allows continuous integration. And it will be installed on a server where the central build will take place.

Ansible : Ansible is a leading DevOps tool. Ansible is an open-source IT engine that automates application deployment, cloud provisioning, intra service orchestration, and other IT tools.

Nagios : Nagios is one of the more useful tools for DevOps. It can determine the errors and rectify them with the help of network, infrastructure, server, and log monitoring systems.

Docker : Docker is a high-end DevOps tool that allows building, ship, and run distributed applications on multiple systems.

Git : Git is an open-source distributed version control system that is freely available for everyone. It is designed to handle minor to major projects with speed and efficiency.
Following are some useful prerequisites for DevOps implementation :
* Proper communication between the team members.
* At least one version control software.
* Automated testing.
* Automated deployment.
The core operation of DevOps with application development and infrastructure are :
Application development :
* Code building
* Code coverage
* Unit testing
* Packaging
* Deployment

Infrastructure :
* Provisioning
* Configuration
* Orchestration
* Deployment
HTTP or Hypertext Transfer Protocol works in a client–server model like the most other protocols. HTTP provides a way to interact with web resources by transmitting hypertext messages between clients and servers.
Technical benefits :
* Continuous software delivery
* Less complex problems to fix
* Faster bug resolution

Business benefits:
* Faster delivery of features for customer satisfaction
* More stable operating environments
* More time available to add product value
KPI Means Key Performance Indicators are used to measure the performance of a DevOps team, identify mistakes and rectify them. This helps the DevOps team to increase productivity and which directly impacts revenue.
There are many KPIs which one can track in a DevOps team. Following are some of them :
Change Failure rates : This is used to measure the number of failures in deployments.

Meantime to recovery (MTTR) :
The time is taken to recover from a failed deployment.

Lead time :
This helps to measure the time taken to deploy on the production environment.

Deployment frequency :
This measures how frequently a new feature is deployed.

Change volume :
This is used to measure how much code is changed from the existing code.

Cycle time :
This is used to measure total application development time.

Customer Ticket :
This helps us to measure the number of errors detected by the end-user.

Availability :
This is used to determine the downtime of the application.

Defect escape rate :
This helps us to measure the number of issues that are needed to be detected as early as possible.

Time of detection :
This helps you understand whether your response time and application monitoring processes are functioning correctly.
Continuous deployment is fully automated, and the deployment to production needs no manual intervention in continuous deployment; whereas, in continuous delivery, the deployment to production requires some manual intervention for change management in the organization, and it needs to be approved by the manager or higher authorities to be deployed in production. According to your organization’s application risk factor, continuous deployment/delivery approach will be chosen.

continuous deployment and continuous delivery
* High availability
* Collaboration friendly
* Data redundancy and replication
* Only one Git directory per repository
* Superior disk utilization and network performance
* Can be used for any sort of projects
The command ‘git pull’ pulls any new commits from a branch from the central repository and then updates the target branch in the local repository.
But, ‘git fetch’ is a slightly different form of ‘git pull’. Unlike ‘git pull’, it pulls all new commits from the desired branch and then stores them in a new branch in the local repository.
In order to reflect these changes in your target branch, ‘git fetch’ must be followed with a ‘git merge’. The target branch will only be updated after merging with the fetched branch (where we performed ‘git fetch’). We can also interpret the whole thing with an equation like this:
git pull = git fetch + git merge
* Faster development of software and quick deliveries.
* Customer satisfaction is enhanced.
* DevOps methodology is flexible and adaptable to changes easily.
* Compared to the previous software development models confusion about the project is decreased due to which the product quality is increased.
* The gap between the development team and operation team is bridged. i.e, the communication between the teams has been increased.
* Efficiency is increased by the addition of automation of continuous integration and continuous deployment.
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.
SSH stands for Secure Shell and is an administrative protocol that lets users have access and control the remote servers over the Internet to work using the command line.
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.
Configuration management (CM) is basically a practice of systematic handling of the changes in such a way that system does not lose its integrity over a period of time. This involves certain policies, techniques, procedures, and tools for evaluating change proposals, managing them, and tracking their progress along with maintaining appropriate documentation for the same.
CM helps in providing administrative and technical directions to the design and development of the appreciation.
The following diagram gives a brief idea about what CM is all about :
DevOps Configuration Management
The various phases of the DevOps lifecycle are as follows:
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.

Code :
The application is coded as per the end-user requirements. 

Build :
Build the application by integrating various codes formed in the previous steps.

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.

Deploy :
Code is deployed into a cloud environment for further usage. It is ensured that any new changes do not affect the functioning of a high traffic website.

Operate :
Operations are performed on the code if required.

Monitor :
Application performance is monitored. Changes are made to meet the end-user requirements.

Different Phases in DevOps

 The above figure indicates the DevOps lifecycle.
Continuous monitoring in DevOps

Continuous monitoring in DevOps is a process of detecting, identifying, and reporting any faults or threats in the entire infrastructure of the system.
* Ensures that all services, applications, and resources are running on the servers properly.
* Monitors the status of servers and determines if applications are working correctly or not.
* Enables continuous audit, transaction inspection, and controlled monitoring.
CAMS stands for Culture, Automation, Measurement, and Sharing. It represents the core deeds of DevOps.
Continuous Integration (CI) is a software development practice that makes sure developers integrate their code into a shared repository as and when they are done working on the feature. Each integration is verified by means of an automated build process that allows teams to detect problems in their code at a very early stage rather than finding them after the deployment.
Continuous Integration (CI) in DevOps
Based on the above flow, we can have a brief overview of the CI process.
* 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.
Continuous Testing (CT) is that phase of DevOps which involves the process of running the automated test cases as part of an automated software delivery pipeline with the sole aim of getting immediate feedback regarding the quality and validation of business risks associated with the automated build of code developed by the developers.
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.
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.
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
i) DevOps is not development driven.
ii) 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
Memcached is an open-source and free in-memory object caching system that has high performance and is distributed and generic in nature. It is mainly used for speeding the dynamic web applications by reducing the database load.
Memcached can be used in the following cases :
* Profile caching in social networking domains like Facebook.
* Web page caching in the content aggregation domain.
* Profile tracking in Ad targeting domain.
* Session caching in e-commerce, gaming, and entertainment domain.
* Database query optimization and scaling in the Location-based services domain.

Benefits of Memcached :
* Using Memcached speeds up the application processes by reducing the hits to a database and reducing the I/O access.
* It helps in determining what steps are more frequently followed and helps in deciding what to cache.

Some of the drawbacks of using Memcached are :
* 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.
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
* This branching type ensures that a particular feature of a project is maintained in a branch.
* Once the feature is fully validated, the branch is then merged into the main branch.

Task 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.
CBD stands for Component-Based Development. It is a unique way for approaching product development. Here, developers keep looking for existing well-defined, tested, and verified components of code and relieve the developer of developing from scratch.
Resilience Testing is a software process that tests the application for its behavior under uncontrolled and chaotic scenarios. It also ensures that the data and functionality are not lost after encountering a failure.
The difference between continuous testing and automation testing is given below :
Continuous Testing Automation Testing
This is the process of executing all the automated test cases and is done as part of the delivery process. This is a process that replaces manual testing by helping the developers create test cases that can be run multiple times without manual intervention.
This process focuses on the business risks associated with releasing software as early as possible. This process helps the developer to know whether the features they have developed are bug-free or not by having set of pass/fail points as a reference.
I will approach this task by copying the jobs directory from the old server to the new one. There are multiple ways to do that; I have mentioned them below:
You can:
* Move a job from one installation of Jenkins to another by simply copying the corresponding job directory.
* Make a copy of an existing job by making a clone of a job directory by a different name.
* Rename an existing job by renaming a directory. Note that if you change a job name you will need to change any other job that tries to call the renamed job.
To create a backup, all you need to do is to periodically back up your JENKINS_HOME directory. This contains all of your build jobs configurations, your slave node configurations, and your build history. To create a back-up of your Jenkins setup, just copy this directory. You can also copy a job directory to clone or replicate a job or rename the directory.
My approach to this answer will be to first mention how to create Jenkins job. Go to Jenkins top page, select “New Job”, then choose “Build a free-style software project”.
Then you can tell the elements of this freestyle job:
* Optional SCM, such as CVS or Subversion where your source code resides.
* Optional triggers to control when Jenkins will perform builds.
* Some sort of build script that performs the build (ant, maven, shell script, batch file, etc.) where the real work happens.
* Optional steps to collect information out of the build, such as archiving the artifacts and/or recording javadoc and test results.
* Optional steps to notify other people/systems with the build result, such as sending e-mails, IMs, updating issue tracker, etc..
Here are some cloud computing platform used for DevOps implementation, such as:
* Google Cloud
* Amazon Web Services
* Microsoft Azure
Azure DevOps is also known as Microsoft visual studio team services (VSTS). It is a set of collaborative development tools built for the cloud. VSTS was commonly used as a standalone term, and Azure DevOps is a platform which is made up of a few different products, such as:
* Azure Test Plans
* Azure Boards
* Azure Repos
* Azure Pipeline
* Azure Artifacts
Here are some reasons which make AWS DevOps a highly popular, such as :
* AWS CloudFormation
* AWS CloudWatch
* AWS CodePipeline
For Chrome :
WebDriver driver = new ChromeDriver();​

For Internet Explorer (IE):
WebDriver driver = new InternetExplorerDriver();

For Firefox :
WebDriver driver = new FirefoxDriver();
* It supports only web-based applications.
* It does not support the Bitmap comparison.
* No vendor support is available for Selenium compared to commercial tools like HP UFT.
* As there is no object repository concept, maintainability of objects becomes very complex.
The driver.close command closes the focused browser window. But, the driver.quit command calls the driver.dispose method which closes all browser windows and also ends the WebDriver session.
It is found at one of the following locations :
Unix/Linus Systems :
Windows :
%PROGRAMDATA%\PuppetLabs\code (usually, C:\ProgramData\PuppetLabs\code)
Non-root users :
Ansible is an open-source automation tool, which is categorized into two types of servers :
* Controlling machines
* Nodes

Ansible will be installed on the controlling machine, and using that machine nodes are managed with the help of SSH. Nodes’ locations are specified by inventories in that controlling machine.
Since Ansible is an agentless tool, it doesn’t require any mandatory installations on remote nodes. So, there is no need of background programs to be executed while it is managing any nodes.
Ansible can handle a lot of nodes from a single system over an SSH connection with the help of Ansible Playbooks. Playbooks are capable of performing multiple tasks, and they are in the YAML file format.
Ansible can help in :
* Configuration Management
* Application Deployment
* Task Automation
Handlers in Ansible are just like regular tasks inside an Ansible Playbook, but they are only run if the task contains a ‘notify’ directive. Handlers are triggered when it is called by another task.
Sudo is a program for Unix/Linux-based systems that provides the ability to allow specific users to use specific system commands in the system’s root level. It is an abbreviation of ‘superuser do’, where ‘super user’ means the ‘root user’.
Nagios Remote Plugin executor”  popularly known as NERP enables us to execute the Nagios plugins remotely. With the help of this mechanism, we can check the performance parameters of the remote Machine.
Nagios runs on a server either as a background process or as a service. Nagios will run the plugins regularly with the help of the hosts or servers present in your Network. We can check the status information by using the web interface. It will execute the scripts based on a schedule.
The major benefits of automation testing are listed below :
* Supports wider test coverage of application features
* Ensures consistency
* Allows parallel execution
* Improves efficiency
* Reusable test scripts
* Saves money and time
* Reliable results
Infrastructure as code (IaC) is a method to manage and provision IT infrastructure (networks, databases, connection topology, etc.) through source code, rather than manual process or interactive configuration tools.

It helps you to automate the infrastructure deployment process easily, consistently, and reliably.
Configuration management and provisioning infrastructure, both are important for the DevOps toolchain. While configuration management is best when it comes to employing desired configurations for target machines or groups of machines, provisioning helps you to create, modify, delete, and track infrastructure using APIs or code.
* Ansible playbook is a structured unit of scripts that describes work for server configuration. It is used for repeated actions.

* An ad-hoc command is used to do something quicker, mostly one-time use.
* A Docker container is an open-source software development platform that stores the code and all of its dependencies and runs the application quickly and reliably from one computing environment to the other.

* Docker containers are not specified to any particular infrastructure; they can run on any infrastructure, on any computer, and in any cloud.

* A Docker container image is a standalone, lightweight, and executable package of software that has everything to run the application such as code, system tools, runtime, system libraries, and settings.

Docker Containers can be created with the Docker image using the following command :
docker run -t -i <image name> <command name>
This will create and start the container.
If you want to check the list of all running containers with status on the host, use the following command:
docker ps -a
If you have any additional DevOps questions and are unable to find the answers, please do mention them in the comment section below. We’ll get back to you at the earliest.
The auto-deployment feature is used for determining whether there are any new applications or changes in existing applications and dynamically deploy them.
It is enabled for servers that run in development mode.
To turn off the auto-deployment feature, follow one of the methods to place servers in production mode :
* In the Administration Console, click the name of the domain in the left pane and select the Production Mode checkbox in the right pane.
* At the command line, include the following argument when starting the domain’s Administration Server:
* Production mode is set for all WebLogic Server instances in a given domain.
To enable startup sound
* Click control gear and then click on Startup Applications
* In the Startup Application Preferences window, click Add to add an entry
* Then fill the information in comment boxes like Name, Command, and Comment
/usr/bin/canberra-gtk-play—id= "desktop-login"—description= "play login sound"
* Logout and then login once you are done

You can also open it with shortcut key Ctrl+Alt+T.
When data changes you can update Memcached by
Clearing the Cache proactively : Clearing the cache when an insert or update is made

Resetting the Cache :
It is similar to the first method but rather than just deleting the keys and waiting for the next request for the data to refresh the cache, reset the values after the insert or update.
Dogpile effect is referred to the event when a cache expires, and websites are hit by the multiple requests made by the client at the same time. This effect can be prevented by using a semaphore lock. In this system when value expires, the first process acquires the lock and starts generating new value.
Blue/Green coloring pattern addresses the most important challenges faced during the automatic deployment process. In Blue/ Green Deployment approach, you need to ensure two identical production environment. However, only one among them is LIVE at any given point of time. The LIVE environment is called Blue environment.
When the team prepares the next release of their software, they conduct their final stage of testing in an environment which is known as Green environment. Once verified, the traffic is routed to the Green environment.
Git stash command is used to save the changes temporarily in the working directory. This gives developers a clean directory to work on. They can later merge the changes in the git workflow. If this command is used, the changes in the tracked files are merged in the working directory. Git stash command can be used many times in the git directory. It is used as git stash
By definition, kubectl is a command-line interface for running commands against Kubernetes clusters. Here, ‘ctl’ stands for ‘control’. This ‘kubectl’ command-line interface can be used to deploy applications, inspect and manage cluster resources, and view logs.
Following are the different components of Selenium :
Selenium Integrated Development Environment (IDE) : The Selenium IDE consists of a simple framework and comes with a Firefox plug-in that can be easily installed. This Selenium component should be used for prototyping.

Selenium Remote Control (RC) : It is a testing framework for developers and QA that supports coding in any programming language like Java, PHP, C#, Perl, etc. This helps automate the UI testing process of web applications against any HTTP website.

Selenium WebDriver : It has a better approach to automating the testing process of web-based applications and does not rely on JavaScript. This web framework allows cross-browser tests to be performed.

Selenium Grid : This proxy server works with Selenium RC and with the help of browsers, it is able to run parallel tests on different nodes or machines.
Below are the differences in multiple criteria that show why Docker has advantages over virtual machines.
Memory Space : In terms of memory, Docker occupies lesser space than a virtual machine.

Boot-up Time :
 Docker has a shorter boot-up time than a virtual machine.

Performance :
 Docker containers show better performance as they are hosted in a single Docker engine, whereas, performance is unstable if multiple virtual machines are run.

Scaling :
 Docker is easy to scale up compared to virtual machines.

Efficiency :
 The efficiency of docker is higher, which is an advantage over virtual machines.

Portability :
 Docker doesn’t have the same cross-platform compatibility issues with porting as virtual machines do.

Space Allocation :
 Data volumes can be shared and used repeatedly across multiple containers in Docker, unlike virtual machines that cannot share data volumes.