Top 20 DevOps Interview Questions with Answers

Now a days, cracking a DevOps Interview is not an easy task. There are various processes you have to face and clear them to enter into next round. DevOps technical interview is one of them. For Experienced DevOps Engineer, technical interview is going to be tough as you worked on various DevOps tools. You must know all about handing all infra and new tools. Here we consolidated top 20 DevOps interview questions for experienced techies. Just go through them and you will feel more confident during interviews.

Que:1. What are the popular DevOps tools that you use in your current job?

Ans :  You can include any of the following tools in answer.

  • Jenkins : Jenkins is an open source automation server used as a continuous integration tool. We can build, deploy and run automated tests with Jenkins.
  • GIT : Git is a version control tool used for tracking changes in files and software.
  • Docker : Docker is a popular tool for containerization of services. It is very useful in Cloud based deployments.
  • Nagios/Grafana/Zabbix : Most popular monitoring tools are Nagios, Zabbix and Grafana in IT infrastructure.
  • Splunk : It is a powerful tool for log search as well as monitoring production systems.
  • Ansible : Ansible to automate our DevOps work so that it is reusable such continuous delivery.
  • Kubernetes : Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

Que:2. According to you what are the main benefits of DevOps?

Ans : DevOps is a very popular methodology in Software Development. There are various benefits of DevOps are as follows:

  • Release Velocity : DevOps practice helps in increasing the release velocity. You can release code to production more often and with more confidence.
  • Development Cycle : The complete Development cycle from initial design to production deployment becomes shorter with the help of DevOps Methodology.
  • Deployment Rollback : You can plan for any failure in deployment rollback due to a bug in code or issue in production. This gives confidence in releasing feature without worrying about downtime for rollback.
  • Recovery from Failure : In case of a failure, you can recover very fast with DevOps process.
  • Defect Detection : You can catch defects much earlier than releasing to production with DevOps approach. It improves the quality of the application software.
  • Performance-oriented : Organization follows performance-oriented culture in which teams become more productive and more innovative with DevOps process.
  • Collaboration : Collaboration between development and operations professionals increases.

Que:3. What is the typical DevOps workflow you use in your organization?

Ans: The typical DevOps workflow in our organization is as follows. You can modify it according to yours’.

  • We use Atlassian Jira for writing requirements and tracking defects.
  • Based on the Jira tasks, developers check the code into GIT version control system (VCS).
  • The code checked into GIT VCS is built by using Apache Maven.
  • The build process is automated with Jenkins.
  • During the build process, automated tests run to validate the code checked in by developers.
  • Code built on Jenkins is sent to organization’s Artifactory.
  • Jenkins automatically picks the libraries from Artifactory and deploys it to Production.
  • During Production deployment Docker images are used to deploy same code on multiple hosts.
  • Kubernetes checks the pods (Docker images) and create/Destroy pods are per requirement automatically.
  • Once code is deployed into Production, we use Prometheus & Grafana to monitor the health of production servers.
  • Splunk based alerts inform us of any issues or exceptions in production.

Que:4. How does CloudFormation work in AWS?

Ans: AWS cloudformation is used to deploy AWS resources such as EC2 instances, creating Amazon s3 buckets and many more. In CloudFormation, you have to first create a template for a resource. A template is a simple text file that contains information about a stack on AWS.
A stack is a collection of AWS resources that you want to deploy together on AWS as a group. Once template is ready and submitted to AWS, cloudFormation will create all the resources in the template. This helps in automation of building whole environments in AWS.

Que:5. What is CICD in DevOps?

Ans: CICD stands for Continuous Integration and Continuous Delivery. These are two different concepts that are complementary to each other.

Continuous Integration : In CI, all developers’ work is merged to main branch several times in a day. This helps in reducing integration problems. As a devops try to minimize the duration for which a branch remains checked out. A developer gets early feedback on the new code added to main repository by using CI.

Continuous Delivery : In CD, a software team plans to deliver software in short cycles. They perform development, testing and release in such a short time that incremental changes can be easily delivered to production. As a DevOps we create a repeatable deployment process that can help achieve the objective of Continuous Delivery.

Que:6. What is the difference between Continuous Delivery and Continuous Deployment?

Ans: The following are the main difference between continuous delivery & continuous deployment.

Continuous delivery is a devops practice in which code changes are prepared to be released to production. However, keep in mind that the codes must pass the automated unit testing, integration testing, system testing before being pushed to production.

Continuous deployment takes a further step from continuous delivery. It is a devops practice that ensures code changes are continuously released into the production environment. The goal is to release a new version whenever developers make changes and automatically get those changes to the end users.

Que:7. What are the main benefits of Ansible?

Ans: Ansible is a powerful tool for IT Automation for complex large scale delivery, deployments and configuration management. It increases the productivity of teams. Some of the main benefits of Ansible are as follows:

  • Productivity : It helps in delivering and deploying application softwares with speed. It increases productivity in an organization.
  • Automation : Ansible provides very good options for automation. With automation, people can focus on delivering smart solutions.
  • Large-scale : Ansible can be used in small as well as very large-scale organizations.
  • Simple DevOps : With Ansible, you can write playbooks for IT automation in a human-readable language i.e YAML. This simplifies the task of DevOps.

Read More : Ansible Tutorial – An Advanced Overview of Ansible

Que:8. What is Docker Hub?

Ans: Docker Hub is a cloud-based docker registry. Docker Hub is a central repository for container image discovery, distribution, change management, workflow automation and team collaboration. You can use Docker Hub to link code repositories. You can even build images and store them in Docker Hub. It also provides links to Docker Cloud to deploy the images to our on-premise or cloud hosts.

Que:9. What is Multi-factor authentication?

Ans: In security implementation, we use Multi-factor authentication (MFA). In MFA, a user is authenticated by multiple means before providing access to a specific resource or service. It is different from simple user & password based authentication. The most popular implementation of MFA is Two-factor authentication. In most of the organizations, we use username & password and an RSA token as two factors for authentication. With MFA, the system becomes more secure and it cannot be easily hacked.

Que:10. Why Automated Testing is a must requirement for DevOps?

Ans: In DevOps methodology, we release software with a high frequency into production. We have to run tests to gain confidence on the quality of software deliverables. Running tests manually is a time taking process.

Therefore, we first prepare automation tests and then deliver softwares. This ensures that we catch any defects early in our process.

Que:11. What is Chaos Monkey in DevOps?

Ans: Chaos Monkey is a strategy made popular by Netflix. In Chaos Monkey, we intentionally try to shut down the services or create failures. By failing one or more services, we test the reliability and recovery mechanism of the Production architecture. It checks whether our applications and deployment have survival strategy built into it or not.

Que:12. What are the main services of AWS you have used?

Ans: You can elaborate what cloud technology you are using. Here are few main services of AWS in our environment:

  • EC2 : This is the Elastic Compute Cloud by Amazon. It is used to for providing computing capability to a
    system. We can use it in places of our standalone servers. We can deploy different kinds of applications on EC2.
  • S3 : We use S3 in Amazon for our storage needs.
  • DynamoDB : We use DynamoDB in AWS for storing data in NoSQL database form.
  • Amazon CloudWatch : We use CloudWatch to monitor our application in Cloud.
  • Amazon SNS : We use Simple Notification Service to inform users about any issues in Production environment.

Que:13. Why GIT is considered better than CVS (Centralized) for version control system?

Ans:  The main difference is that Centralized VCS keep the history of changes on a central server from which everyone requests the latest version of the work and pushes the latest changes to. This means that everyone sharing the server also shares everyone’s work.

On the other hand, on Git ie. Distributed VCS, everyone has a local copy of the entire work’s history. This means that it is not necessary to be online to change revisions or add changes to the work. “Distributed” comes from the fact that there isn’t a central entity in charge of the work history, so that anyone can sync with any other team member. This helps avoid failure due to a crash of the central versioning server.

Read More : An Overview of Git – Core Concepts of Distributed Version Control System

Que:14. What is the difference between a Container and a Virtual Machine?

Ans:  In below table, we elaborated main differences between VM and Container.

                     Virtual Machine                       Container
Hardware level process isolation OS level process isolation
Each VM has a separate OS Each container can share OS
Boots in minutes Boots in seconds
VMs are of few GBs Containers are lightweight (KBs/MBs)
Ready made VMs are difficult to find Pre built docker containers are easily available
VMs can move to new host easily Containers are destroyed and recreated rather than moving
Creating VM takes a relatively longer time Containers can be created in seconds
More Resource Usage Less Resource Usage

Read More : Docker Tutorial – An Advanced Overview of Docker

Que:15. Are you more Dev or more Ops?

Ans: This is a tricky question. DevOps is a new concept and in any organization the maturity of DevOps varies from highly
Operations oriented to highly DevOps oriented. In some projects teams are very mature and practices DevOps in its true form.

In some projects, teams rely more on Operations team. As a DevOps person I give first priority to the needs of an organization and project. At some times I may have to perform a lot of operations work. But with each iteration, I aim to bring DevOps changes incrementally to an organization.

Que:16. What is Passive check in Nagios?

Ans: In Nagios, we monitor hosts and services by active checks. In addition, Nagios also supports Passive checks. Passive checks are initiated and performed by external applications/processes. The results of Passive checks are submitted to Nagios for processing.

There are two main use cases of Passive checks:

  • We use Passive checks to monitor asynchronous services that do not give positive result with Active checks at
    regular intervals of time.
  • We can use Passive checks to monitor services or applications that are located behind a firewall.

Que:17. How will you remove an image from Docker?

Ans: We can use docker rmi command to delete an image from our local system. The exact command as follows:

docker rmi <Image Id>

If we want to find image IDs of all the Docker images in our system, we can use following command.

docker images

If we want to remove a docker container then we use below command.

docker rm <Container Id>

Read More : Docker – Basic Commands

Que:18. We wrote a shell script in Unix but it is not doing anything. What could be the reason?

Ans: After writing a shell script we have to give it execute permission so that it can be run in Unix shell.

We can use chmod command to change the permission of a file in Unix. In general we use chmod +x to give execute permission to users for executing the shell script.

For instance, chmod +x abc.txt will give execute permission to users for executing the file abc.txt.

With chmod command we can also specify to which user/group the permission should be granted. The options are:

  • u is the owner user
  • g is the owner group
  • o is others
  • a is all users

Que:19. How will you check if a remote host is still alive?

Ans: We can use ping command line utility. With ping command we can ping a remote host. Ping utility sends packets in an IP network with ICMP protocol. Once the packet goes from source to destination and comes back it records the time. We can even specify the number of packets we want to send so that we collect more statistics to confirm the result.

$  ping <hostname of remote server>

$  ping <ip address of remote server>

Another option is to use telnet to remote host to check if it is reachable.

Que:20. How will you find which process is taking most CPU time in linux machine?

Ans: We can use top command to list the CPU time and memory used by various processes. The top command lists the process IDs and CPU time, memory etc used by top most processes. Top command keeps refreshing the screen at a specified interval. So we can see over the time which process is always appearing on the top most row in the result of top command. You can use shift+p with top command to list the High CPU consuming process at the top. This is the process that is consuming most CPU time.

top command

 

Read Also : Top 20 Linux Interview Questions For Experienced SysAdmins

 

Share on:

Ravindra Kumar

Hi, This is Ravindra. I am founder of TheCodeCloud. I am AWS Certified Solutions Architect Associate & Certified in Oracle Cloud as well. I am DevOps and Data Science Enthusiast.

Recommended Reading..

Leave a Comment