DevOps is increasingly becoming a popular way to build and deploy applications which has translated into increasing demand for DevOps professionals.
This article will cover some of the most frequently asked DevOps interview questions and their answers. Using these questions as core to study can increase your chances of getting hired, or if you are a recruiter, they can help you in the hiring process.
Frequently Asked DevOps Interview Questions and Answers
What is DevOps?
DevOps is the short form of development and operations. This software engineering practice brings together the development and operation teams to automate every stage of a project. A DevOps team focuses on Resource management, communication, and teamwork.
DevOps is an approach aimed at improving work throughout the software development lifecycle. The DevOps process is depicted as an infinite loop, comprising the stages of planning, coding, building, testing, releasing, deploying, operating, and monitoring.
DevOps influences the application lifecycle throughout its planning, development, delivery, and operation phases. Each phase depends on the others, and the phases are not specific to a role. In a true DevOps culture, each role is involved in each phase to some degree.
What are the different phases in DevOps methodology
- Continuous development. This is the planning and coding phase.
- Continuous integration. This is the phase where the development team integrates different components and ensures the code does not break.
- Continuous testing. This is the prescheduled and automated testing phase.
- Continuous deployment. This phase ensures hassle-free development, which does not affect the entire app’s performance.
- Continuous monitoring. This phase ensures the overall efficacy of the app.
- Continuous feedback. Issues and performance, as reported by end-users, are analyzed.
- Continuous operations. Allows devs to build better versions of the product and detect issues fast.
What are the benefits of DevOps?
Teams that take a DevOps approach tend to get their projects done faster. This way, communication errors are avoided, facilitating the rapid implementation of improvements and other necessary changes. The DevOps approach encourages greater collaboration between the development and operations teams, where the goals of all of them are more aligned. You can summarize some of the benefits as follows:
- Improved communication
- Teamwork and cohesion
- Improved collaboration
- Faster delivery of quality products
- Reduced complexity and quick problem resolution
- Greater scalability and flexibility to add new code
- More stable operating environments
- Greater automation
- Cost reduction and resource utilization
- Security through integrated and automated tools
Name some DevOps tools
- Continuous Integration Tools such as Jenkins
- Version Control such as Git
- Build Tools such as Maven
- Configuration Management Tools such as Chef
- Container Platforms such as Docker
Name some DevOps KPI
- Deployment frequency
- Change volume
- Deployment time
- Failed deployment rates
- Time detection
- Defect escape rate
What is CI/CD, and what are its benefits?
Continuous integration (CI)
CI combines tools and practices that make it easy to deliver high-quality, rapid software. This way, bottlenecks are eliminated, and technical problems are avoided in the launch phases.
Continuous Delivery (CD)
This practice automates the delivery of code changes, ensuring that the code can be quickly supplemented in production and that applications function correctly.
Continuous Deployment (CD)
Unlike continuous delivery, the objective of this practice is that there is no human intervention when deploying the software in production. Publishing new or changed code to production is automated.
CI/CD implements DevOps throughout the application lifecycle. These practices help improve productivity in the different phases of the software development process by streamlining and automating them.
What is microservices architecture, and how is it different from traditional architecture?
The traditional method of writing software is monolithic. It means that all the functions of an application are gathered in a single block. In case of errors or need to update, the code that governs the entire product is analyzed.
It generates stops or even crashes and represents a great danger to the conservation of the code. For customers, it means losses and headaches.
In a microservices architecture, an application’s functions represent an independently developed and integrated service. The components are separate but work together to perform the correlated tasks.
In this way, each independent service runs without interfering with the others, which also applies in failure cases. If a function fails, it is possible to adjust it without compromising the functioning of the entire application.
Microservices arrive to make DevOps even more agile and efficient, accelerating end-to-end development and making applications even more scalable.
Difference between DevOps and Agile
DevOps is a culture that fosters collaboration among all the team members involved in the development and maintenance of software.
Agile is a development methodology designed to make teams productive and drive releases based on changing needs.
What is Infrastructure as code?
Infrastructure as code is the approach to defining the computing and network infrastructure, which uses source code management techniques and is treated like any software system.
This code may be kept in source control to allow for audibility and reproducible construction, subject to testing practices and the full discipline of Continuous Delivery.
Infrastructure as code is based on a few practices:
- Use definition files
- Self-documented systems and processes
- Version all elements
- Continuously test systems and processes
- Small changes instead of batches
- Keep services available continuously
What is the Role of AWS in DevOps?
AWS has a set of flexible services that help companies to reliably and rapidly develop applications. AWS services simplify deploying code, provisioning & simplifying infrastructure, automating software release processes, and monitoring the infrastructure performance.
What is the use of SSH?
SSH (Secure Shell) is a protocol that allows a secure connection between different computers. SSH serves different purposes, such as offering; strong authentication, strong encryption, maintaining connection integrity, strong connection and security.
What is a DevOps Pipeline?
The DevOps pipeline is a process that encompasses several steps before releasing new software. It can be applied in all phases of the project, from integration and testing to delivery and deployment. In general, it goes through the following stages and teams:
- Product Vision: defines the features of the product;
- Dev Team: develops iteratively and incrementally;
- Area of operation: implements and maintains stable environments;
- Monitoring and feedback: seek to generate value and use by the customer.
What is configuration management?
It is a system’s engineering process of establishing and maintaining consistency of a system’s/product’s performance and functional and physical attributes throughout its lifecycle.
What is continuous testing?
This is prescheduled and automated testing of an application as development goes on.
What is Git?
This is an open-source and free tool for source code management. This tool is designed to handle small and big projects.
Mention some basic Git commands
- Git clone
git clone <https://name-of-the-repository-link>
- Git branch
git branch <branch-name>
- Git checkout
git checkout <name-of-your-branch>
- Git add
git add <file>
- Git commit
git commit -m "commit message"
- Git push
git push <remote> <branch-name>
- Git pull
git pull <remote>
Explain the difference between Git merge and Git rebase
Git merge command allows devs to merge different Git branches while the logs of commits of the respective branches remain intact.
Git rebase command allows developers to integrate changes from one branch to another, and the logs are changed once the process is complete.
Explain the difference between Git fetch and Git pull
Git fetch tells git to retrieve/ check the latest metadata from the original. However, it doesn’t do any file transfer but just checks.
Git pull checks and brings changes from the remote repository to the local project.
What is a merge conflict?
Merge conflicts occur when you merge two branches with competing commits. Merge conflicts usually occur when different developers change the same line of code or file.
What is version control, and What are the different types?
Version control (source control) is the process of tracking and managing changes to software code.
These are the different types of version controls;
- Centralized– have a single “central” copy of source code on a server and all the changes are committed to the ‘central’ copy. Subversion (SVN) and Perforce are examples of centralized version controls.
- Distributed (DVCS)-don’t have a central server to store all the project’s files. Git and Mercurial are examples of DVCS.
What are the benefits of using version control?
- Helps developers preserve efficiency and agility
- Gives a complete log of every change to a project/ file
- Improve traceability
- Helps in managing merging and branching
- Enables collaboration
What is branching?
Branching refers to creating a separate/ new version of the main repository. Branches allow you to work on various parts of the project without impacting the main branch.
What are Branching strategies?
Merging strategies are the methodologies that software development teams adopt when writing, merging and deploying code. Such an approach ensures that bugs and mistakes are fixed at a branch stage before they are merged with the main project.
Explain a few types of tests used in DevOps?
They test a specific piece of code in isolation. Unit tests must not be connected to the database, use the file system, talk to external systems, or interact with system components. It allows them to run quickly, and you get quick feedback if changes have broken existing functionality.
They test large groups of features so that they can identify problems like these. They are generally slower, requiring more complex configuration and more I/O connecting to a database, file system, or other systems.
Such tests verify that the deployment worked, in other words, that your application is correctly installed, configured, can access whatever services it needs, and is responding.
Apart from these, there are also exploitation and useability tests. To know more about testing, check the article on types of application testing.
What is automation testing, and how to automate testing in DevOps?
Automation testing is a technique of automatically reviewing and validating code. Automation testing is done to check whether quality standards for functionality (business logic), code style, and user experience have been met.
Automation testing is done using tools such as Selenium and Katalon.
What is Build Automation, and what are some build automation tools?
Build automation tools specify how the software should be built (what steps need to be done and in what order) and what dependencies are required (what other software needs to be present for the build to be successful).
Some tools are better suited for projects in specific programming languages, such as Maven and Apache’s Ant, which, while technology can be used with other languages, are mostly used in Java projects. Others, like Hudson or Jenkins, can be used more widely with various projects.
What is Jenkinsfile?
Jenkinsfile is a text file containing the definition of a Jenkins pipeline. Jenkinsfile is checked into the source control repository. Some of its uses are; it permits an audit trail for the pipeline, allows code review and iteration on the pipeline, and gives a single source of truth in the pipeline.
Explain the architecture in Jenkins
Jenkins has a master-slave architecture. This means there are many ‘slaves’ working for one ‘master. The Jenkins Distributed Build can thus run identical tests on different environments, with results collected and combined on the master node for monitoring.
What are the top Jenkins plugins?
- Blue Ocean Plugin for Jenkins
- Mailer Plugin for Jenkins
- Git plugin for Jenkins
- Jira plugin for Jenkins
- Docker plugin for Jenkins
- Maven Integration Plugin for Jenkins
- Kubernetes plugin for Jenkins
- SonarQube Plugin for Jenkins
- Amazon EC2 Plugin for Jenkins
What is Selenium IDE?
Selenium IDE is a tool that records browser interactions for test cases. You can set breakpoints and check and pause variables when errors occur with Selenium Integrated Development Environment.
What are the different Selenium components?
- Selenium IDE
- Selenium RC
- Selenium WebDriver
- Selenium Grid
What are the different types of testing in Selenium?
- End-to-end testing
- Regression testing
- System testing
- Performance testing
- Compatibility testing
What are the different exceptions in Selenium?
What are driver.close() and driver.quit() in WebDriver?
driver.close() command closes the browser window on focus. If only one browser is open, it closes the entire browser session.
driver.quit() command closes the entire browser session with browser pop-ups, tabs and windows.
What is a Dockerfile?
Dockerfile is a text document with all the commands a user can use on a command line to assemble an image.
Differences between docker images and docker container
Docker images are read-only templates crafted with source codes, tools, libraries, external dependencies, and other files needed for any application to run successfully on any operating system or platform.
A docker container is a box that runs docker image templates.
Explain the architecture of Docker
Docker follows a Client-Server architecture and comprises Docker Client, Docker Host, and Docker Registry.
Docker Client uses REST APIs and commands to communicate with Server (Docker Daemon).
Docker Client uses CLI to run these commands
docker build docker pull docker run
- Docker Host provides an environment to execute and run applications. Made up of docker daemon, storage, images, containers, and networks.
- Docker Registry manages and stores Docker images.
Cloud platforms that support docker
The platforms that support docker hosting are;
- Google Cloud Run
- A2 Hosting
- Amazon ECS
- Microsoft Azure
What is the difference between containers and virtual machines?
Both the Container and the VM work with virtualization and isolation of environments to promote processing independently of applications. Still, Containers create isolated environments where different applications can run simultaneously because the division is made at the level of available resources, such as memory and processing. On the other hand, the Virtual Machine allows a physical machine to house others with different operating systems, hard disks, and hardware-independent from the original ones.
What is the main difference between Docker and Kubernetes?
Docker is one of the most used DevOps container tools. It focuses on the portability of applications, placing them in technological containers and packaging systems and moving them across different platforms.
At the same time, Kubernetes is a container orchestration tool that can group containers by logical categorization. It can be deployed to multiple computers through automated distribution.
Read more about Kubernetes Vs. Docker.
What does platform virtualization mean, and what are its benefits?
Platform virtualization means simulating an entire computer system to run multiple instances of operating systems simultaneously on a single physical machine.
In this configuration, a virtual machine monitor (VMM), or hypervisor, has full control of the physical machine’s hardware resources. Guest operating systems run in virtual machines, which VMM manages. Environment virtualization involves simulating one or more virtual machines and the network connections between them.
Virtualization can help reduce the time spent on deployment and the risks associated with it in several ways. The use of virtual machines in deployment is a huge help in achieving effective configuration management vertically and horizontally across your systems.
In particular, the use of virtualization brings the following benefits:
- Quick response to changing requirements
- Ease of maintenance of baselines
What is Nagios?
Nagios is a tool that monitors the entire IT infrastructure to ensure that business processes, systems, services, and applications are functioning properly.
How does Nagios work?
- Monitoring. IT staff configures Nagios to monitor network protocols, system metrics, applications, network infrastructure, services, and servers.
- Alerting. Nagios sends alerts when critical components fail. Alerts can be through SMS, custom code or emails.
- Response. IT team acknowledges alerts and acts.
- Reports. Reports that provide a historical record of notifications, outages, alert responses, and events for later review are generated.
- Maintenance. Scheduled downtime prevents alerts from being sent during maintenance.
Mention some Plugins in Nagios
- Official Nagios plugins-developed and maintained by the official team
- Custom plugins-written by individuals/businesses to suit individual needs
- Community plugins-developed by the members of the Nagios community
Explain virtualization with Nagios
Nagios offers the capability to monitor various metrics on various virtualization platforms. Nagios can run from various virtualization platforms such as Xen, Amazon EC2, VMware, and Microsoft Virtual PC.
How does Nagios help with monitoring?
Nagios uses agents like NRPE, check_mk or SNMP to collect statistics on your server and send an alert if the metrics are above the predefined threshold.
What port numbers does Nagios use for monitoring purposes?
SNMP, ports 161 and 162
What is a Nagios network analyzer?
Nagios network analyzer is a sflow data analysis software that allows users to proactively resolve abnormal behaviors, outages, and security threats before interrupting business operations. This commercial-grade tool offers extended insight into network traffic and IT infrastructure.
Variables that affect inheritance and recursion in Nagios
- Name-a template ‘name’ that can inherit the object variables/ properties.
- Use- specify the template’s object name from which you want to inherit variables/ properties.
- Register indicates whether the template object’s name should be ‘registered’ with Nagios.
What is Puppet?
Puppet is an open-source tool for software configuration management and deployment.
What is a Puppet manifest?
Puppet manifest is a file that contains Puppet configuration language that describes how resources should be configured.
What is the Puppet code?
Puppet code is a declarative code, meaning that you describe it using your system’s desired state and not the steps needed to get there.
What is Chef?
Chef is a configuration management tool that converts infrastructure to code. This tool focuses on writing code instead of the manual process.
How does Chef work?
Chef’s work begins when system admins or developers define tasks to be automated. The cookbooks and recipes (small programs written in a domain-specific language) are then captured and tested using various tools like Test Kitchen, ChefSpec, and Foodcritic.
If the cookbooks and recipes are working as expected, they are then deployed to the Chef server using knife and chef command-line tools. A chef deployment process has a Chef server, workstations, and nodes. You can choose from over 3000 cookbook templates and customize them to your needs. The Chef will then take care of the rest of the work.
Tell us about your experience managing DevOps projects
DevOps skills are not just about technical know-how and require human and managerial skills often found among managers, program directors, and project managers.
It is essential to know how to manage and support change, provide a gateway to facilitate the transfer of new versions of code to the operations side, evaluate and monitor the various platforms and tools to measure performance, and analyze and share results to improve future deliveries, etc.
Approach this question with methodology and explain your journey in solving complex problems. How do you intend to go about improving the functioning of the infrastructures? How do you plan to collaborate with front, middle and back-office developers? What monitoring tools do you master? Also, consider sharing your conflict resolution experiences within your team.
According to Glassdoor, the average salary of a DevOps engineer is $104281 per year in the US. Even though DevOps is a new career, we can now see more companies hiring for this role and publishing various courses to equip professionals with the essential skills. Above are some questions you will likely encounter in a DevOps interview.
You may also explore some good online courses to learn DevOps.
With inputs from Titus Kamunya.