These DevOps interview questions are examples of real tasks used by employers to screen job candidates such as DevOps engineers, developers, and others that require knowledge of the DevOps lifecycle, practices, and tools.
1. DevOps Lifecycle
Your company has been working to increase its frequency of deployment for new features by optimizing its full development and operating lifecycle. The CEO wants to cut unnecessary phases to deliver new features to the customer.
Which phases are not part of the core DevOps lifecycle?
(Select all acceptable answers.)
2. Container Restart
The automation team is testing their background Docker web server containers. They need to cleanly remove the existing containers without leaving any artifacts behind, then start new containers.
Complete the following docker commands to achieve these objectives:
# Gracefully end all processes in the containers host> docker-compose stop # Remove the containers and their anonymous volumes host> docker-compose -v # Start containers in background host> docker-compose up apache php mysql
3. Force Checkout
A developer is experimenting with code on a local copy of a branch. After a while, it is decided that this experiment does not work. So the developer decides to switch back to the master branch. However, the developer's local working copy is different from the HEAD.
Which of these options would allow the developer to successfully check out the master branch?
(Select all acceptable answers.)
4. Incident Response
The CEO of your company understands that sometimes things go wrong. No system is perfect, but she wants to ensure that the company is improving.
Which metrics could be used to track the company's incident management?
(Select all acceptable answers.)
5. Saving a Bugfix
Write down a sequence of GIT commands (with no additional arguments) to download a repository, update a file, and save the changes back to the original repository. Assume that other developers didn't modify the file.
- Download the master repository to a local directory or repository:
git https://joe@testdome.com/testdome.git
- Fix a bug in file test.cpp
- Mark that file test.cpp has been changed:
git test.cpp
- Save the changes to the local repository:
git -m 'Bug with testing is fixed'
- Send the changes to the original repository:
git origin master
6. File Ingress
Consider the following Ingress controller:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: main-ingress
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: main-app
servicePort: 80
- path: /files/
pathType: Prefix
backend:
serviceName: file-app
servicePort: 80
- path: /files/default.png
pathType: Exact
backend:
serviceName: default-app
servicePort: 8080
Select all the true statements.
(Select all acceptable answers.)
7. Nginx Deployment
The team responsible for Kubernetes wants to add a Deployment that will deploy 4 nginx Pods which should have port 443 open. Finish the following YAML configuration so that it implements those requirements:
apiVersion: apps/v1
kind:
metadata:
name: deployment-nginx
labels:
web: public
spec:
replicas:
selector:
matchLabels:
web: public
template:
metadata:
labels:
:
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- : 443
8. Container Lifecycle
As part of a load balancing scheme, your company uses multiple virtual machines which can provision and deprovision Docker containers as demand changes.
Complete the docker commands (with no additional arguments) that manage the lifecycle of a docker image.
- When a virtual machine completes startup, it runs the following command to ready the custom container image:
docker create --name balanced-container company-image
- When the load balancer detects high usage, it signals the virtual machine to make the container available for use. The VM runs the following command:
docker balanced-container
- The load balancer detects that a container has been underutilized for more than 15 minutes. It signals the VM to suspend the container to conserve CPU resources. The VM runs the command:
docker balanced-container
- Finding an increased load again, the load balancer signals the VM to awaken the container. The VM runs the command:
docker balanced-container
- After an hour of underutilization, the load balancer signals the VM to gracefully end all processes in the container to conserve RAM resources. The VM runs the command:
docker balanced-container