0% found this document useful (0 votes)
46 views

Devops Interview Questions and Answer

Uploaded by

demy2014
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Devops Interview Questions and Answer

Uploaded by

demy2014
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

DEVOPS INTERVIEW QUESTIONS

1. What is Devops?
(Development +
Operations)
Automation in all stages of Software Development life cycle.
Increase’s speed of delivering applications

Benefits:
Faster Deployment Time
Collaborative Work
environment Defect fixes at
an early Stage Quick
Releases

2. Can you name devops Tools and their uses

1
3. What is the role of Configuration Management? Some examples?

Process in which Servers/Sytems are automated,monitored


and managed
Avoids any manual Installation and configuration and
accidental changes
Example: Ansible,Terraform,salt

4. Difference between Continuous Integration and Continuous


Delivery?

Continuous Integration Continuous Delivery & Deployment


Automatically building Continuous deployment: Automated
and testing Code. Run Deployments till production without
Tests automatically for any manual Intervention(One Click
every new Code commits deployment)
pushed
Continuous Delivery: Automated
Deployments till production with
some manual interventions
Depends upon company use cases
Uses: Less Bugs shipped Quick Feature releases which helps
to production companies

2
5. Can you name some of CI/CD Tools?
Jenkins, Gitlab, Azure Devops Pipeline,ArgoCD,Circle ci etc

6. What is Docker?

Docker Containers are standardized, executable


components that combine application source code with the
operating system (OS) libraries and dependencies required
to run that code in any environment.

[OS+Libraries] Packaged

3
7. What is Docker File?
Contains Instruction for creating Docker Image

Example

FROM nginx
COPY index.html

/usr/share/nginx/html/index.html Cmd : docker

build -t test:v1 .

8. What is Docker Image?


Blue print for libraries and dependencies required inside
container for application to run
Used to create a container
Can be stored in Repository (Docker hub,gitlab

registry) # docker push vdr/app:v1

9. What is Docker container?


When you run a image it becomes container
4
# docker run –name devops -d app:v1
#docker stop devop

5
What is Kubernetes?

Kubernetes, also known as K8s, is an open source system for


automating deployment, scaling, and management of
containerized applications. It is a Container Orchestration tool for
containers

What are Different Devops Deployment Types?

Blue/Green Deployment Canary Deployment


Maintains 2 identical Rolling/Go live for specific
Environments. One for subset of users first before
Production and one for new releasing them to
version production.

Router/Load Balancer for


redirecting some requests to
new server
Use Case: Financial systems Use Case: 1. Strong focus on UX
which should not have changes
downtime when switching on 2. Incremental
Major Releases Deployments
Advantages: No downtime Advantages: New software
Disadvantage: Cost release Less Cost

6
10. What are the differences between
Containerization and Virtualization?

Virtualization Containerization
Developers can run multiple Deploy multiple applications
operating systems on the under the same operating
hardware of single physical system on single physical
server server

11.What is Regression Testing?


Regression testing assesses how an application
behaves after a new change has been implemented.

12.What is Load Balancing?


Load balancing is the process of evenly distributing incoming
network traffic across a group of backend servers.

19 What is Monitoring and Observability?

Monitoring Observability
Tracking and Data Collection Use findings (data)from
helps Devops Team better Monitoring to diagnose
understand the current state problems and actively
of system resolve them through
debugging.
Proactive and take actions
(Artificial Intelligence)
Ex: Prometheus,grafana Ex:
Prometheus,grafana,Newreli
c
7
21)How do you monitor the performance of
Application and Infrastructure?
Application → Prometheus,Grafana/Datadog/Dynatrace
Infrastructure - Prometheus,Grafana

22)How to ensure Security in Devops Process?


Enable SAST scanning - Static application security
scanning - Analyse source code for security vulnerabilities
Opensource SAST tools: Sonar,Snyk
Container Scanning: Snyk
Enterprise: Gitlab premium, Fortify Sast

24) What is Helm?

Helps to manage Kubernetes applications. Helm charts


help you define, install,upgrade applications

23)How do you rollback deployments ?

8
In case of application failure in Kubernetes we can use
helm rollback command

Kubectl: kubectl rollout undo deployment/app --to-


revision=2 (OR)
Helm: helm rollback <releasename> <versionnumber>

24)What scripting Tools mainly used for


devops? Python and bash

25)What do you know about Cloud platform


Providers? IAAS - Infrastructure as a service
Cloud providers -
AWS,GCP,Azure,Alibaba
cloud,salesforce,Digital Ocean,IBM,Dell

26)What is difference between Microservice and


Monolithic applications?

Monolithic Microservice
Single (often massive) unit A microservice is an
where all functions and architectural style that
services are interconnected structures an application as
and run as a single process. a collection of small, loosely
coupled, and independently
deployable services

9
27)Difference between Horizontal scaling Vs Vertical Scaling

Horizontal Scaling Vertical Scaling


1. Adding more Adding more resources (CPU,
machines or instances RAM, storage) to an existing
to your infrastructure. machine.

2. Ex: Distributed Disadvantage: Limited by the


systems and cloud maximum capacity of the
environments. hardware.

28)How to Handle secrets in Devops Pipeline?


i) Use secret Management tool HashiCorp Vault, AWS
Secrets Manager, or Azure Key Vault to securely store and
retrieve secrets.

10
ii) Storing secrets in environment variables managed by the
CI/CD tool.

11
29)Difference between Gitops and Traditional CICD

GITOPS CICD Traditional


GitOps is a practice that
uses Git as the single Configurations may be
source of truth for scattered across various tools
infrastructure and and scripts.
application
management
manual steps for deployment.
changes are
automatically applied by
reconciling the desired
state in Git with the
actual state in the
environment

GitOps emphasizes a
declarative approach
where the desired
state is defined in Git

12
30)What are main components of Kubernetes Cluster?

MASTER NODE
COMPONENTS

WORKER NODE
COMPONENTS

13
OTHERS

31)What is Autoscaling?

It is a cloud computing feature that automatically adjusts the


number of resources allocated to a workload based on demand.

Cloud: AWS autoscaling


Kubernetes: HPA(Horizontal Pod autoscaling)

32)Difference between High availability and Disaster recovery


in Cloud Environment?

High Availability Disaster Recovery


Website/service is accessible Ability to continue providing
even if one or servers is down service even in the face of a
regional network outage (when
multiple sections of the world
are rendered unreachable).
Auto-Scaling Multi-Region
14
Deployment,Failover
Mechanisms:

15
33)What is VPC?
Creating and isolating resources within Virtual Private Clouds
(VPCs), organizing them into subnets, and controlling traffic using
security groups and network ACLs.

34)Difference between security group and network acl?

Security Group Network ACL


Control inbound and outbound Operates in VPC subnet level
traffic at the instance level,

Supports only Allow


Rules Supports both allow and deny
rules

35)What is Serverless Computing?


Serverless computing is a cloud computing model where the
cloud provider automatically manages the infrastructure,
allowing developers to focus solely on writing and deploying
code. In this model, you don't have to manage servers or worry
about scaling, as the cloud provider dynamically allocates
resources as needed.

One of the great qualities of this model is that you pay only for
the compute time your code actually uses, rather than for pre-
allocated infrastructure

36)Name some ansible modules and uses?

apt or yum or package module: Used to install


software or packages in Operating systems
Users: setup non-root users for login.
16
service / systemd : To make service up and running
Lineinfile: replace some pattern in a file

17
Ping: to check if ansible hosts are reachable
Setup: to gather information about Target hosts
ansible remotehost -m setup -u ec2-user
Command: To execute commands on remote Node
Script: To execute scripts
Copy: to copy files from remote source
Get_url: Download files using http remote url
File: creates files
Blockinfile: Insert/update/remove block of
multiline text
Debug: For debugging variables/expression and
print execution

18
37) What is Devsecops?
Implement security in a DevOps pipeline (DevSecOps) and
integrate security practices throughout the development and
deployment process.

SAST → DAST (Dynamic security testing)→helm lint—>


Container scanning(snyk)-> Deployment

38)What is the Kubernetes operator ?

Kubernetes offers limited initial functionality to ensure


flexibility and scalability. K8s Operators are software
extensions that make use of Kubernetes APIs to extend
behavior.
Use Cases:

● The ability to deploy an application on demand;

● Making a backup of an application state or restarting an

application from a given backup;

● Managing the update of an application with all its

dependencies including new configuration settings and

necessary database changes;

● Exposing a service to applications that do not support

Kubernetes APIs.

39)What is Inode in linux ?


In Linux, an inode, or index node, is a data structure that
stores metadata about files and directories in a file system
Each file and directory in Linux has an inode assigned to it when

19
it's created. Inodes are stored in blocks, just like files are stored
in units of a given size.

20
40)What is /etc/fstab used
for? Used to mount file
system

41)Command to find server Load and other


information top

21
42)What are iptables in linux?

22
It is a firewall to allow and deny access to certain services/ports

Example:
sudo iptables -A INPUT -s 203.0.113.51 -j REJECT
sudo iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate
NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate
NEW,ESTABLISHED -j ACCEPT

43)What are Cgroups (control groups) in linux?

Used to limit resources(CPU,mem) that specific user can access


in system

Commands:
cgcreate -g cpu,memory:/<cgroup_name>. #Creating a cgroup
with the user or users you want to control.
cgset -r cpu.cfs_quota_us=50000 -r memory.limit_in_bytes=1G
<cgroup_name>. # Limit CPU usage to 50% and memory usage
to 1GB: cgclassify -g cpu,memory:<cgroup_name> <username>
#add a user to the cgroup.

44)Important Linux commands with explanation

find /path/to/directory -type f -mmin -30. # Find all files that are
modified in last 30 minutes

Crontab -l # To schedule recurring tasks

find /path/to/start/directory -depth -type d -empty -exec rmdir {}


\; # Delete all empty dirs

23
netstat -tulp # List open ports in linux server

24
grep <pattern># Search pattern in Text files

ps aux --sort=-%cpu | head -n 10. # Top 10 process of CPU usage

45)What are Terraform providers?

They are drivers which help terraform to connect to Cloud


/Onprem resources or services

46)Name some CICD Tools and uses


Jenkins,Gitlab,Circle ci,Azure devops pipeline, AWS code deploy ….

47)How to reduce costs in Cloud/On prem resources?

Script to shutdown instances during off working


hours Autoscaling using spot instances

48)What are types of provisioners in Terraform?


Remote exec: Run commands using Terraform on a remote server
Local exec: Run commands using Terraform on the local system

25
49)What databases familiar?

26
Mysql,postgres,Oracle
# Command to Take mysql backup of a database
mysqldump -u [uname] -p db_name >
db_backup.sql.

50)What are different types of Http


requests? GET: Fetch Data
POST: Post or submit data to server
PUT: Update a resource or data on the server
PATCH: Applies partial updates to a resource on the
server HEAD: To retrieve headers

27

You might also like