Skip to content

Complete DevOps guide for beginners and freshers, featuring CI/CD, Docker, AWS, Terraform, and hands-on projects. Learn, practice, and showcase real-world DevOps skills in one place.

Notifications You must be signed in to change notification settings

tanvirmulla11/DevOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ DevOps Interview Guide

Welcome to the DevOps Interview Preparation Repository. This guide helps you revise the most commonly asked questions with clear answers specially designed for freshers and job seekers in Cloud and DevOps roles.

πŸ“š Table of Contents


Linux 🐧

πŸ”Ή 1. What is Linux?
Linux is an open-source, Unix-like operating system based on the Linux kernel. It is widely used in servers, development, and embedded systems.
πŸ”Ή 2. What is the difference between Linux and Unix?
Unix is proprietary, while Linux is open-source. Linux is more commonly used in modern systems.
πŸ”Ή 3. What is the Linux kernel?
The kernel is the core of Linux, managing hardware, memory, and processes.
πŸ”Ή 4. What is a shell in Linux?
The shell is a command-line interface to interact with the OS (e.g., Bash).
πŸ”Ή 5. What are inodes?
Inodes store metadata about files, like permissions and timestamps, not filenames.
πŸ”Ή 6. What are runlevels in Linux?
Runlevels define the system state (e.g., 0 = halt, 3 = multi-user, 5 = GUI, 6 = reboot).
πŸ”Ή 7. What is the difference between a process and a thread?
A process is an independent program; a thread is a lightweight subprocess within it.
πŸ”Ή 8. What is the difference between hard and soft links?
Hard links point to file data (inode), soft links point to filenames (symbolic links).
πŸ”Ή 9. What is a zombie process?
A zombie process has finished execution but still exists in the process table.
πŸ”Ή 10. What is swap space?
Swap is disk space used as virtual memory when RAM is full.
πŸ”Ή 11. What are the types of permissions in Linux?
Read (r), Write (w), Execute (x) for User, Group, and Others.
πŸ”Ή 12. What is chmod?
`chmod` is used to change file or directory permissions.
πŸ”Ή 13. What does chmod +x file.sh do?
It makes the shell script file executable.
πŸ”Ή 14. What is chown used for?
`chown` changes file ownership (user and/or group).
πŸ”Ή 15. What is the difference between > and >>?
`>` overwrites a file, `>>` appends to it.
πŸ”Ή 16. How to check system memory usage?
Use `free -h`, `top`, `htop`, or `vmstat`.
πŸ”Ή 17. How to schedule a task in Linux?
Use `cron` for recurring tasks, `at` for one-time tasks.
πŸ”Ή 18. What is crontab?
`crontab` defines jobs for cron to run at specific times.
πŸ”Ή 19. What is the use of grep?
`grep` searches text using patterns or regular expressions.
πŸ”Ή 20. What is the difference between su and sudo?
`su` switches to another user; `sudo` runs a command as another user (typically root).
πŸ”Ή 21. What is systemd?
Systemd is a system and service manager used to bootstrap and manage services.
πŸ”Ή 22. What is the ps command?
`ps` displays running processes. Example: `ps aux`.
πŸ”Ή 23. How to find a file in Linux?
Use `find /path -name filename` or `locate filename`.
πŸ”Ή 24. What does df -h show?
Shows disk space usage in a human-readable format.
πŸ”Ή 25. What is the difference between kill and killall?
`kill` ends a process by PID; `killall` ends all processes by name.

Networking 🌐

πŸ”Ή 1. What is a network?
A network is a group of interconnected devices that communicate and share resources.
πŸ”Ή 2. What is an IP address?
An IP address is a unique identifier for a device on a network, used for routing traffic.
πŸ”Ή 3. What is the difference between IPv4 and IPv6?
IPv4 uses 32-bit addresses (e.g., 192.168.1.1), while IPv6 uses 128-bit (e.g., fe80::1).
πŸ”Ή 4. What is a subnet mask?
It determines the network and host portions of an IP address.
πŸ”Ή 5. What is DNS?
DNS (Domain Name System) translates domain names into IP addresses.
πŸ”Ή 6. What is DHCP?
DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses to devices.
πŸ”Ή 7. What is the difference between TCP and UDP?
TCP is connection-oriented and reliable; UDP is connectionless and faster but less reliable.
πŸ”Ή 8. What is NAT?
NAT (Network Address Translation) maps private IP addresses to public ones.
πŸ”Ή 9. What is a firewall?
A firewall filters incoming and outgoing traffic based on security rules.
πŸ”Ή 10. What is the OSI model?
The OSI model is a conceptual framework with 7 layers that describe network communication.
πŸ”Ή 11. What layer is DNS in the OSI model?
DNS operates at the Application layer (Layer 7).
πŸ”Ή 12. What is a port number?
Ports identify specific processes/services on a device (e.g., HTTP = 80, SSH = 22).
πŸ”Ή 13. What is ping used for?
`ping` checks network connectivity by sending ICMP echo requests.
πŸ”Ή 14. What is traceroute?
`traceroute` shows the path packets take to reach a destination.
πŸ”Ή 15. What is localhost?
Localhost (127.0.0.1) refers to the local computer's network interface.
πŸ”Ή 16. What is a VPN?
A VPN (Virtual Private Network) securely connects remote users to a private network.
πŸ”Ή 17. What is latency?
Latency is the delay between sending and receiving data, usually measured in milliseconds.
πŸ”Ή 18. What is bandwidth?
Bandwidth is the maximum data transfer rate over a network path.
πŸ”Ή 19. What is the default gateway?
It is the IP address that routes traffic from a local network to other networks.
πŸ”Ή 20. What is ARP?
ARP (Address Resolution Protocol) maps IP addresses to MAC addresses on a local network.

Git πŸ”§

πŸ”Ή 1. What is Git?
Git is a distributed version control system used to track changes in source code during software development.
πŸ”Ή 2. What is the difference between Git and GitHub?
Git is a version control system, while GitHub is a cloud-based platform that hosts Git repositories.
πŸ”Ή 3. What is a repository in Git?
A repository (repo) is a storage space where your project’s code and its history are stored.
πŸ”Ή 4. What is the difference between a local and remote repository?
A local repository exists on your machine; a remote repository is hosted on a server like GitHub or GitLab.
πŸ”Ή 5. What is a branch in Git?
A branch is a separate line of development. The default branch is usually `main` or `master`.
πŸ”Ή 6. How do you create a new branch?
Use `git branch branch-name` to create and `git checkout branch-name` to switch.
πŸ”Ή 7. What is the difference between `git merge` and `git rebase`?
`git merge` combines branches and creates a merge commit. `git rebase` moves or reapplies commits on top of another base branch.
πŸ”Ή 8. What is a commit in Git?
A commit is a snapshot of the repository at a specific point in time.
πŸ”Ή 9. What does `git status` do?
It shows the current status of your working directory and staging area.
πŸ”Ή 10. What is the staging area in Git?
It's a place where changes are kept before committing them with `git commit`.
πŸ”Ή 11. What does `git add` do?
It adds changes to the staging area, preparing them for a commit.
πŸ”Ή 12. What is the difference between `git pull` and `git fetch`?
`git pull` fetches changes and merges them into your local branch. `git fetch` only downloads changes, not merging them.
πŸ”Ή 13. What does `git clone` do?
It copies a remote repository to your local machine.
πŸ”Ή 14. What is a conflict in Git, and how do you resolve it?
A conflict occurs when changes in two branches clash. You resolve it manually and then commit the fix.
πŸ”Ή 15. How do you undo a commit?
Use `git revert` to create a new commit that undoes changes, or `git reset` for local history changes.
πŸ”Ή 16. What is `.gitignore`?
A file that tells Git which files or directories to ignore in a project.
πŸ”Ή 17. What is a detached HEAD in Git?
It means you're not on any branch but on a specific commit. Commits made here won’t belong to any branch.
πŸ”Ή 18. What is `git stash`?
It temporarily saves changes that are not ready to be committed so you can work on something else.
πŸ”Ή 19. How do you see the commit history?
Use `git log` to view the commit history.
πŸ”Ή 20. How do you contribute to an open-source project using Git?
1. Fork the repo 2. Clone your fork 3. Create a branch 4. Make changes 5. Commit and push 6. Open a pull request (PR)

☁️ GCP Interview Questions & Answers

1️⃣ What is Google Cloud Platform (GCP)? GCP is a suite of cloud computing services provided by Google. It offers IaaS, PaaS, and SaaS solutions, including compute, storage, networking, Big Data, and AI/ML services.
2️⃣ What is Google Compute Engine? Google Compute Engine (GCE) is GCP’s IaaS component, allowing users to create and manage virtual machines (VMs) on Google’s infrastructure.
3️⃣ What are GCP Projects? A GCP Project is a logical container that groups together resources like VMs, APIs, billing, and IAM. Projects provide isolation and billing boundaries.
4️⃣ What is the role of IAM in GCP? IAM (Identity and Access Management) controls who can access what in a GCP project. It assigns roles to users and service accounts to manage permissions.
5️⃣ What is a Service Account? A service account is a special type of Google account used by applications or VMs to interact with GCP APIs securely.
6️⃣ Difference between Preemptible and Standard VM instances? Preemptible VMs are short-lived, cost-effective instances that can be terminated by GCP anytime (after 24h max). Standard VMs are stable, long-running instances.
7️⃣ What is Google Cloud Storage? It’s a globally unified object storage service for unstructured data like files, images, backups, and logs.
8️⃣ Explain GCP’s networking components. Key components include: - VPC (Virtual Private Cloud) - Subnets - Firewalls - Routes - Cloud Load Balancing
9️⃣ What is GKE? Google Kubernetes Engine (GKE) is a managed Kubernetes service for running containerized applications in production.
πŸ”Ÿ What is Cloud Pub/Sub? It’s a messaging service that enables asynchronous communication between services using a publisher-subscriber model.
πŸ”’ 11. What is the use of Cloud Functions? Cloud Functions is a serverless compute service for running event-driven functions without managing infrastructure.
πŸ”’ 12. What is BigQuery? BigQuery is GCP’s fully managed data warehouse designed for fast SQL analytics over large datasets.
πŸ”’ 13. How does GCP handle regions and zones? Regions are specific geographical locations; each region has multiple zones. Zones are isolated locations within a region.
πŸ”’ 14. Difference between GCP roles: Owner, Editor, and Viewer? - Owner: Full access to all resources - Editor: Modify existing resources - Viewer: Read-only access
πŸ”’ 15. What is Cloud Run? Cloud Run is a fully managed compute platform that automatically scales containers in response to HTTP requests.
πŸ”’ 16. What is GCP Marketplace? It is a platform to deploy third-party solutions, like WordPress, Jenkins, and MongoDB, directly to GCP.
πŸ”’ 17. What is Stackdriver (now called Cloud Operations)? It is a suite of tools for monitoring, logging, tracing, and diagnostics of applications and infrastructure.
πŸ”’ 18. How is billing handled in GCP? Billing is linked to GCP projects and can be managed via budgets, alerts, and cost analysis tools in the Billing Console.
πŸ”’ 19. What is Cloud Spanner? A globally distributed, horizontally scalable, and strongly consistent relational database service.
πŸ”’ 20. What is the Shared VPC in GCP? It allows multiple projects to share a common Virtual Private Cloud network, simplifying policy enforcement and connectivity.

☁️ AWS – DevOps Interview Questions

πŸ”Ή 1. What is AWS?
Amazon Web Services (AWS) is a comprehensive cloud computing platform offering IaaS, PaaS, and SaaS services such as compute, storage, databases, networking, machine learning, and more.
πŸ”Ή 2. What is EC2?
Amazon EC2 (Elastic Compute Cloud) provides scalable virtual servers in the cloud.
πŸ”Ή 3. What is S3?
Amazon S3 (Simple Storage Service) is an object storage service with high scalability, durability, and availability.
πŸ”Ή 4. What are IAM roles and policies?
IAM (Identity and Access Management) allows you to define permissions using users, roles, and policies to securely control access to AWS resources.
πŸ”Ή 5. What is an AMI?
An AMI (Amazon Machine Image) is a pre-configured template used to launch EC2 instances.
πŸ”Ή 6. What is the difference between a Security Group and NACL?
Security Groups act as virtual firewalls for instances, while NACLs (Network Access Control Lists) control traffic at the subnet level.
πŸ”Ή 7. What is an Elastic Load Balancer (ELB)?
ELB automatically distributes incoming traffic across multiple targets (EC2 instances, containers, etc.) to ensure high availability.
πŸ”Ή 8. What is Auto Scaling?
Auto Scaling automatically adjusts the number of EC2 instances to handle traffic changes based on defined policies.
πŸ”Ή 9. What is VPC?
Amazon VPC (Virtual Private Cloud) lets you provision a logically isolated network in AWS where you can launch resources.
πŸ”Ή 10. What are subnets?
Subnets divide a VPC into smaller IP ranges, enabling isolation and routing of resources across different availability zones.
πŸ”Ή 11. What is the difference between Public and Private subnets?
Public subnets have internet access via an Internet Gateway; private subnets do not.
πŸ”Ή 12. What is CloudWatch?
Amazon CloudWatch monitors AWS resources and applications, providing logs, metrics, and alarms.
πŸ”Ή 13. What is the difference between CloudFormation and Terraform?
CloudFormation is AWS's native Infrastructure as Code (IaC) service, while Terraform is cloud-agnostic and supports multiple providers.
πŸ”Ή 14. What is Route 53?
Amazon Route 53 is a scalable DNS and domain name management service.
πŸ”Ή 15. What is EBS?
Amazon EBS (Elastic Block Store) provides persistent block storage for EC2 instances.
πŸ”Ή 16. What is EFS?
Amazon EFS (Elastic File System) is a scalable, shared file storage for use with EC2 instances.
πŸ”Ή 17. What is an AWS Region and Availability Zone?
A Region is a geographic area; an Availability Zone is an isolated data center within a region.
πŸ”Ή 18. What is Lambda?
AWS Lambda is a serverless compute service that lets you run code in response to events without provisioning or managing servers.
πŸ”Ή 19. What is S3 Versioning?
S3 Versioning allows you to keep multiple versions of an object in the same bucket to prevent accidental deletions or overwrites.
πŸ”Ή 20. What is the Shared Responsibility Model?
AWS secures the infrastructure; customers are responsible for securing their data, applications, and configurations.

☁️ Azure – DevOps Interview Questions

πŸ”Ή 1. What is Microsoft Azure?
Microsoft Azure is a cloud computing platform offering a wide range of services including computing, analytics, storage, and networking.
πŸ”Ή 2. What is the difference between Azure and AWS?
Both are cloud providers, but Azure integrates better with Microsoft services like Active Directory and Windows Server. AWS offers broader service availability.
πŸ”Ή 3. What is an Azure Resource Group?
A Resource Group is a container that holds related resources for an Azure solution. It allows for management of those resources as a group.
πŸ”Ή 4. What is Azure Virtual Machine?
Azure VM provides Infrastructure-as-a-Service (IaaS) that allows you to run virtualized Windows or Linux machines in the cloud.
πŸ”Ή 5. What is Azure DevOps?
Azure DevOps is a set of development tools for software development teams including pipelines, boards, repos, test plans, and artifacts.
πŸ”Ή 6. What is the difference between Azure DevOps and GitHub Actions?
Azure DevOps offers a comprehensive suite of services, while GitHub Actions is CI/CD for GitHub repositories, integrated directly into GitHub.
πŸ”Ή 7. What is Azure Active Directory (AAD)?
Azure AD is Microsoft's cloud-based identity and access management service, used for employee sign-in and access control.
πŸ”Ή 8. What is an Azure Subscription?
A subscription is an agreement with Azure to use cloud services. It links to billing and provides access to Azure products.
πŸ”Ή 9. What are Availability Sets and Availability Zones?
Availability Sets protect against hardware failures within a data center. Availability Zones protect against data center-level failures.
πŸ”Ή 10. What is Azure Blob Storage?
Blob Storage is Azure's object storage solution for unstructured data like images, videos, and documents.
πŸ”Ή 11. What is Azure Kubernetes Service (AKS)?
AKS is a managed Kubernetes service that simplifies container orchestration in Azure.
πŸ”Ή 12. What is the difference between Azure Functions and Logic Apps?
Azure Functions are serverless compute services for custom code. Logic Apps are workflow automation tools that use connectors and triggers.
πŸ”Ή 13. What is the Azure CLI?
Azure CLI is a command-line tool used to manage Azure resources directly from the terminal or command prompt.
πŸ”Ή 14. What is Azure ARM Template?
ARM (Azure Resource Manager) Templates are JSON files that define infrastructure and configuration for automated deployments.
πŸ”Ή 15. What is Azure Policy?
Azure Policy helps enforce organizational standards and assess compliance at scale across your Azure environment.
πŸ”Ή 16. What is Azure Monitor?
Azure Monitor collects and analyzes telemetry data from your Azure and on-premises resources for observability and diagnostics.
πŸ”Ή 17. What is Azure Application Gateway?
It is a web traffic load balancer that enables you to manage traffic to your web applications using layer 7 routing.
πŸ”Ή 18. What is Azure Key Vault?
Azure Key Vault is used to securely store secrets, keys, and certificates.
πŸ”Ή 19. What is the use of Azure Pipelines?
Azure Pipelines provides CI/CD automation to build, test, and deploy applications across environments.
πŸ”Ή 20. What is the Shared Responsibility Model in Azure?
Azure is responsible for the cloud infrastructure; users are responsible for securing data, applications, and configurations within it.

🧱 Terraform – DevOps Interview Questions

πŸ”Ή 1. What is Terraform?
Terraform is an open-source Infrastructure as Code (IaC) tool developed by HashiCorp that allows you to define and provision infrastructure using a declarative configuration language (HCL).
πŸ”Ή 2. What are the key components of Terraform?
- Providers (e.g., AWS, Azure, GCP) - Resources - Variables - Modules - State - Outputs
πŸ”Ή 3. What is a Terraform provider?
A provider is a plugin that Terraform uses to interact with cloud platforms (e.g., AWS, Azure) and other APIs.
πŸ”Ή 4. What is a Terraform state file?
The state file (`terraform.tfstate`) stores information about the deployed infrastructure and is used to track changes and manage updates.
πŸ”Ή 5. What is the use of `terraform init`?
Initializes the working directory, downloads providers, and sets up the backend.
πŸ”Ή 6. What does `terraform plan` do?
It shows what changes will be made to the infrastructure before applying them, serving as a dry-run.
πŸ”Ή 7. What is the command to apply a configuration in Terraform?
`terraform apply` β€” it executes the plan and provisions the defined resources.
πŸ”Ή 8. What is the difference between `terraform apply` and `terraform destroy`?
- `apply` provisions infrastructure - `destroy` tears down infrastructure defined in your configuration
πŸ”Ή 9. What are Terraform modules?
Modules are reusable Terraform configurations that group related resources together to promote code reusability.
πŸ”Ή 10. What are the benefits of using Terraform?
- Infrastructure as Code - Multi-cloud support - Version control - Modular and reusable code - Automation and consistency
πŸ”Ή 11. How do you manage secrets in Terraform?
Avoid storing secrets in code; use tools like AWS Secrets Manager, Vault, or environment variables.
πŸ”Ή 12. What is Terraform backend?
A backend in Terraform determines how state is loaded and how an operation such as `apply` is executed β€” e.g., local, remote, S3 with DynamoDB locking.
πŸ”Ή 13. How can you lock Terraform state?
By using a remote backend like AWS S3 with DynamoDB for state locking and consistency.
πŸ”Ή 14. What is the difference between `terraform refresh` and `terraform plan`?
- `refresh`: Updates state file with real-world infrastructure - `plan`: Shows proposed changes based on the current state
πŸ”Ή 15. What is a data source in Terraform?
Data sources allow you to fetch or compute data from existing resources outside Terraform's management.
πŸ”Ή 16. How do you use variables in Terraform?
Define them in `variables.tf`, pass them via CLI, environment, or `terraform.tfvars` file.
πŸ”Ή 17. What is output in Terraform?
Outputs display the values of resources after `apply`, useful for sharing values like IPs or URLs.
πŸ”Ή 18. What is the purpose of `.terraform.lock.hcl`?
It ensures consistent provider versions across different environments or team members.
πŸ”Ή 19. Can Terraform be used with CI/CD?
Yes, Terraform can be integrated with CI/CD pipelines (e.g., GitHub Actions, Jenkins, GitLab CI) for automated deployments.
πŸ”Ή 20. What is the difference between Terraform and CloudFormation?
Terraform is multi-cloud and open-source. CloudFormation is AWS-specific. Terraform has better modularity and state management flexibility.

🐳 Docker – DevOps Interview Questions

πŸ”Ή 1. What is Docker?
Docker is a platform for developing, shipping, and running applications in lightweight containers that include everything needed to run the application.
πŸ”Ή 2. What is a Docker container?
A Docker container is a lightweight, standalone, and executable package of software that includes the application and its dependencies.
πŸ”Ή 3. What is the difference between a Docker image and a container?
An image is a snapshot of a container, while a container is a running instance of an image.
πŸ”Ή 4. What is Dockerfile?
A Dockerfile is a script containing instructions to build a Docker image.
πŸ”Ή 5. What is the purpose of the `docker-compose` tool?
`docker-compose` is used to define and manage multi-container Docker applications using a `docker-compose.yml` file.
πŸ”Ή 6. What command is used to build a Docker image?
`docker build -t image-name .`
πŸ”Ή 7. How do you run a container from an image?
`docker run image-name` Or with more options: `docker run -d -p 80:80 --name container-name image-name`
πŸ”Ή 8. What is the difference between `COPY` and `ADD` in Dockerfile?
`COPY` only copies files/directories. `ADD` can also extract tar files and supports URLs.
πŸ”Ή 9. What is a Docker volume?
Volumes are used for persisting data generated and used by Docker containers.
πŸ”Ή 10. What is the default network driver in Docker?
The default driver is `bridge` for standalone containers.
πŸ”Ή 11. How do you list running containers?
`docker ps` – shows running containers. `docker ps -a` – shows all containers.
πŸ”Ή 12. How do you stop a running container?
`docker stop container_id_or_name`
πŸ”Ή 13. How do you remove a container?
`docker rm container_id_or_name`
πŸ”Ή 14. How do you remove an image?
`docker rmi image_name`
πŸ”Ή 15. What is the use of `.dockerignore` file?
It works like `.gitignore`, telling Docker which files/folders to ignore when building an image.
πŸ”Ή 16. What is the difference between `CMD` and `ENTRYPOINT` in Dockerfile?
Both define container execution, but `ENTRYPOINT` is preferred for fixed execution commands; `CMD` provides default arguments.
πŸ”Ή 17. How do you check logs of a container?
`docker logs container_name`
πŸ”Ή 18. What are Docker namespaces?
Namespaces isolate containers, allowing them to have their own network, PID, user, mount points, etc.
πŸ”Ή 19. What is Docker Swarm?
Docker Swarm is Docker’s native orchestration tool to manage a cluster of Docker Engines as a single virtual system.
πŸ”Ή 20. What is the difference between Docker and a Virtual Machine?
Containers share the host OS kernel and are lightweight, while VMs include full guest OS and are heavier in resource usage.

🐳 Kubernetes – DevOps Interview Questions

This section contains 20 essential Kubernetes interview questions and answers β€” designed for DevOps, SRE, and Cloud Engineer interviews in 2025.


πŸ”Ή 1. What is Kubernetes?
Kubernetes is an open-source container orchestration platform used to automate the deployment, scaling, and management of containerized applications.
πŸ”Ή 2. What is a Pod in Kubernetes?
A Pod is the smallest deployable unit in Kubernetes. It can host one or more containers that share the same network namespace and storage.
πŸ”Ή 3. What is etcd?
etcd is a distributed key-value store used to persist all cluster configuration and state in Kubernetes.
πŸ”Ή 4. What is the difference between Deployment and StatefulSet?
- **Deployment**: Used for stateless apps. Supports rolling updates and replicas. - **StatefulSet**: Used for stateful apps. Maintains stable pod identity and persistent storage.
πŸ”Ή 5. What are Kubernetes Services?
A Kubernetes Service is an abstraction that defines a logical set of Pods and a policy by which to access them. Types include ClusterIP, NodePort, and LoadBalancer.
πŸ”Ή 6. What is kube-apiserver?
kube-apiserver is the front-end for the Kubernetes control plane. It validates and configures data for the API objects.
πŸ”Ή 7. What are taints and tolerations?
- **Taints**: Prevent Pods from being scheduled on certain nodes. - **Tolerations**: Allow Pods to be scheduled on nodes with matching taints.
πŸ”Ή 8. What is a Namespace in Kubernetes?
Namespaces provide a mechanism for isolating groups of resources within a single cluster.
πŸ”Ή 9. What is kube-proxy?
kube-proxy maintains network rules on nodes and handles communication to Pods across the cluster.
πŸ”Ή 10. What is ConfigMap vs Secret?
- **ConfigMap**: Stores non-sensitive configuration data. - **Secret**: Stores sensitive information like passwords and API keys in base64 encoded form.
πŸ”Ή 11. What is HPA (Horizontal Pod Autoscaler)?
HPA automatically scales the number of Pods based on CPU utilization or custom metrics.
πŸ”Ή 12. What is a DaemonSet?
A DaemonSet ensures that a copy of a Pod runs on all (or selected) nodes in the cluster.
πŸ”Ή 13. What is a Headless Service?
A Headless Service is a Service without a ClusterIP. It enables direct access to the Pod's IP addresses.
πŸ”Ή 14. How does Kubernetes do service discovery?
Kubernetes uses DNS and environment variables to enable Pods to discover each other and access Services.
πŸ”Ή 15. What is a Helm Chart?
A Helm Chart is a collection of YAML templates used to define, install, and upgrade complex Kubernetes applications.
πŸ”Ή 16. What is the difference between a Node and a Cluster?
- **Node**: A physical or virtual machine that runs Pods. - **Cluster**: A set of nodes managed by the Kubernetes control plane.
πŸ”Ή 17. What is a ReplicaSet?
A ReplicaSet ensures that a specified number of Pod replicas are running at any time.
πŸ”Ή 18. Types of Services in Kubernetes?
- **ClusterIP** (default) – internal-only access - **NodePort** – exposes the service on each node's IP at a static port - **LoadBalancer** – provisioned with external load balancer - **ExternalName** – maps service to a DNS name
πŸ”Ή 19. How to troubleshoot a Pod in Pending state?
- Check node resources using `kubectl describe node`. - Check events using `kubectl describe pod `. - Ensure correct storage class, tolerations, and affinity rules.
πŸ”Ή 20. How do you secure a Kubernetes cluster?
- Enable RBAC (Role-Based Access Control) - Use Network Policies - Regularly update cluster components - Limit container privileges - Use Secrets for sensitive data - Enable audit logging and monitoring

πŸ› οΈ Ansible – DevOps Interview Questions

1. What is Ansible?

Ansible is an open-source automation tool for configuration management, application deployment, and task automation. It uses YAML for playbooks and SSH for agentless communication.

2. How does Ansible work?

Ansible connects to target nodes over SSH, pushes modules to execute tasks, and removes them after execution, ensuring agentless automation.

3. What is an Ansible Playbook?

Playbooks are YAML files that define a set of tasks to be executed on managed hosts. They are reusable and used for multi-step automation.

4. What are Ansible modules?

Modules are reusable scripts used to perform specific tasks like installing packages, copying files, restarting services, etc.

5. What is an inventory file in Ansible?

It lists the hosts or groups of hosts on which Ansible performs tasks. It can be static (INI/YAML) or dynamic (scripts or plugins).

6. What are roles in Ansible?

Roles help in structuring playbooks by organizing tasks, variables, handlers, and templates into reusable directories.

7. Difference between ad-hoc commands and playbooks?
  • Ad-hoc commands are one-liners for quick tasks.
  • Playbooks are YAML-based scripts used for long-term automation.
8. What is the use of Ansible Galaxy?

Ansible Galaxy is a repository for finding, sharing, and reusing Ansible roles created by the community.

9. What are facts in Ansible?

Facts are system properties (e.g., IP, OS) gathered using the setup module and can be used in playbooks as variables.

10. What is Ansible Vault?

Ansible Vault is used to encrypt secrets like passwords or keys.

🐳 Docker Interview Questions and Answers

1. What is Docker?

Docker is an open-source platform that allows developers to automate the deployment of applications inside lightweight, portable containers. It packages code along with its dependencies and environment for consistency across environments.

2. What is the difference between a Docker image and a Docker container?
  • A Docker image is a read-only template with instructions for creating a container.
  • A Docker container is a runnable instance of an image that includes the application and its dependencies.
3. What is a Dockerfile?

A Dockerfile is a text file containing instructions used by Docker to automate the building of an image. It specifies the base image, commands to install packages, copy files, and define startup behavior.

4. What is Docker Compose?

Docker Compose is a tool that allows you to define and manage multi-container Docker applications using a docker-compose.yml file. It simplifies the process of setting up services, networks, and volumes.

5. What is Docker Hub?

Docker Hub is Docker’s public registry where users can share, distribute, and pull container images. It offers official images and supports public and private repositories.

6. How does Docker architecture work?

Docker uses a client-server architecture:

  • The Docker Client sends commands to the Docker Daemon, which builds, runs, and manages containers.
  • Docker uses Images, stored in Registries, to create Containers.
7. How to persist data in Docker?

To persist data in Docker, you can use:

  • Volumes (managed by Docker)
  • Bind mounts (host directory mounted inside container)

These methods ensure data is not lost when the container stops.

8. What are Docker volumes?

Docker volumes are directories managed by Docker and stored on the host machine to persist and share data between containers.

9. What is the difference between bind mounts and volumes?
  • Bind Mount: You specify the exact path on the host.
  • Volume: Managed by Docker in /var/lib/docker/volumes/.

Volumes are preferred for better management and portability.

10. How do you expose ports in Docker?

Use the -p or --publish flag:

---

πŸš€ CI/CD Interview Questions & Answers

This document contains 20 commonly asked CI/CD interview questions and answers designed for Cloud & DevOps Engineers. Ideal for anyone preparing for DevOps roles.


1. What is CI/CD?

CI/CD stands for Continuous Integration and Continuous Deployment/Delivery. CI focuses on automating code integration, while CD automates the release process. Together, they ensure faster and safer software delivery.


2. What are the benefits of CI/CD?
  • Faster release cycles
  • Reduced manual effort
  • Higher code quality
  • Easier debugging
  • Immediate feedback loops

3. What tools are commonly used in CI/CD pipelines?

Popular tools include:

  • Jenkins
  • GitHub Actions
  • GitLab CI/CD
  • CircleCI
  • Travis CI
  • AWS CodePipeline

4. What is a pipeline in CI/CD?

A pipeline is a set of automated steps for building, testing, and deploying applications.


5. What is the difference between Continuous Delivery and Continuous Deployment?
  • Continuous Delivery: Code is deployed to staging or production only after manual approval.
  • Continuous Deployment: Every change passes all stages and is automatically deployed to production.

6. What is a build?

A build is the process of converting source code into an executable format.


7. What is artifact in CI/CD?

An artifact is a compiled binary or package (e.g., .jar, .zip, .deb) generated during a build process.


8. What is version control, and how does it relate to CI?

Version control (like Git) manages code changes. CI relies on it to trigger pipelines upon code commits.


9. How do you trigger a CI/CD pipeline?

Pipelines are triggered by:

  • Code commits or pull requests
  • Scheduled jobs
  • Manual triggers
  • Webhooks

10. What is a webhook in CI/CD?

A webhook notifies the CI/CD system of an event, like a Git push, to trigger automated processes.


11. What is a self-hosted runner?

A self-hosted runner is a machine you configure to run your pipeline jobs (as opposed to cloud-hosted runners).


12. What are stages and jobs in a pipeline?
  • Stages are logical groups of tasks (e.g., Build, Test, Deploy).
  • Jobs are tasks within those stages.

13. What is the role of Docker in CI/CD?

Docker provides consistent environments for builds and deployments. It enables container-based CI/CD.


14. What is Canary Deployment?

Canary deployment releases an update to a small portion of users to verify before full rollout.


15. What is Blue-Green Deployment?

It involves two environments (Blue & Green). One is live, and the other is prepared with updates. Switching happens after testing.


16. What is rollback in deployment?

Rollback is reverting to the previous stable version after a failed deployment.


17. How can you ensure pipeline security?
  • Secure secrets (use vaults)
  • Scan for vulnerabilities
  • Implement role-based access
  • Avoid hardcoding credentials

18. What is Infrastructure as Code in CI/CD?

IaC tools like Terraform or CloudFormation automate infra setup as part of CI/CD workflows.


19. How to monitor CI/CD pipelines?

Use built-in dashboards (Jenkins, GitHub Actions), logs, and integrations with monitoring tools like Prometheus, Grafana.


20. What is the difference between CI and DevOps?

CI is a practice within DevOps focused on integration. DevOps is a broader culture promoting collaboration, automation, and monitoring.


πŸ“ˆ DevOps Methodology, Practices & Agile – Interview Questions

πŸ“˜ Interview Questions & Answers

πŸ”Ή 1. What is DevOps? DevOps is a cultural and technical movement that aims to unify software development (Dev) and IT operations (Ops). It emphasizes collaboration, automation, continuous integration & delivery (CI/CD), and monitoring to deliver software faster and more reliably.
πŸ”Ή 2. What are the core principles of DevOps? - Culture of collaboration - Automation - Continuous feedback - Shared responsibility - Iterative improvement - Monitoring and observability
πŸ”Ή 3. How does DevOps differ from Agile? Agile focuses on software development practices (sprints, scrum, iterations). DevOps expands on Agile by including operations β€” emphasizing deployment, automation, and system reliability post-development.
πŸ”Ή 4. What are the stages in a DevOps lifecycle? - Plan - Develop - Build - Test - Release - Deploy - Operate - Monitor
πŸ”Ή 5. What is CI/CD? CI/CD stands for Continuous Integration and Continuous Delivery/Deployment. It involves automatically building, testing, and deploying code changes, ensuring faster and reliable software delivery.
πŸ”Ή 6. What is Shift Left Testing? Shift Left Testing refers to testing earlier in the software development lifecycle, enabling faster bug detection, reducing cost, and improving quality.
πŸ”Ή 7. What is Infrastructure as Code (IaC)? IaC is the practice of managing and provisioning infrastructure using code (e.g., Terraform, CloudFormation). It helps automate deployments and ensures consistent environments.
πŸ”Ή 8. What are some popular DevOps tools? - Version Control: Git - CI/CD: Jenkins, GitHub Actions, GitLab CI - Configuration Management: Ansible, Chef - Containerization: Docker, Kubernetes - Monitoring: Prometheus, Grafana - IaC: Terraform, Pulumi
πŸ”Ή 9. What is the role of a DevOps Engineer? A DevOps Engineer builds and maintains CI/CD pipelines, manages infrastructure automation, ensures system reliability, integrates monitoring, and fosters collaboration between teams.
πŸ”Ή 10. What is a feedback loop in DevOps? A feedback loop provides real-time insights between development, testing, and operations, helping teams rapidly detect and correct issues throughout the delivery lifecycle.
πŸ”Ή 11. What are Agile ceremonies? - Daily stand-ups - Sprint planning - Sprint review - Retrospective These promote transparency, collaboration, and iterative delivery.
πŸ”Ή 12. What is the difference between Continuous Delivery and Continuous Deployment? - **Continuous Delivery**: Ensures every code change is deployable; manual approval may be needed. - **Continuous Deployment**: Automatically deploys every change after passing tests, no manual step.
πŸ”Ή 13. What are Microservices in DevOps? Microservices are small, loosely coupled services that work independently and are deployed separately. DevOps pipelines often manage and scale them efficiently.
πŸ”Ή 14. What is Mean Time to Recovery (MTTR)? MTTR measures how quickly a system can recover from a failure. Lower MTTR indicates better resilience.
πŸ”Ή 15. What is Trunk-Based Development? It is a source control strategy where all developers commit to a single branch (trunk), enabling faster integration and fewer merge conflicts.
πŸ”Ή 16. What are some DevOps anti-patterns? - Treating DevOps as a team, not a culture - Siloed Dev and Ops roles - Lack of automation - Manual deployments - Ignoring security (no DevSecOps)
πŸ”Ή 17. What is a value stream in DevOps? A value stream is the series of steps an organization uses to deliver value to the customer, from idea to production.
πŸ”Ή 18. What is DevSecOps? DevSecOps integrates security into the DevOps process, ensuring secure code practices, scanning, and policy enforcement throughout the pipeline.
πŸ”Ή 19. What metrics are used to measure DevOps success? - Deployment Frequency - Lead Time for Changes - Change Failure Rate - Mean Time to Recovery (MTTR) - Customer satisfaction (CSAT)
πŸ”Ή 20. What is the CALMS model in DevOps? **CALMS** stands for: - **Culture** - **Automation** - **Lean** - **Measurement** - **Sharing** It’s a framework for evaluating DevOps maturity and adoption.

πŸ“‚ Add this to your DevOps Interview Guide or CI/CD Project Repo.

πŸ“˜ Keep building your cloud confidence β€” one concept at a time!

About

Complete DevOps guide for beginners and freshers, featuring CI/CD, Docker, AWS, Terraform, and hands-on projects. Learn, practice, and showcase real-world DevOps skills in one place.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published