Put your DevOps skills to the test with 20 interview questions covering Docker, Kubernetes, CI/CD, AWS basics, Linux, Git, Terraform, and Jenkins. Essential preparation for DevOps and SRE interviews.
Below are all 20 questions covered in this quiz, grouped by topic. Each question includes the correct answer and a detailed explanation to help you prepare for your next interview.
What is the difference between a Docker image and a Docker container?
An image is a read-only template; a container is a running instance of an image
A Docker image is a read-only template containing the application code, dependencies, and runtime. A container is a running instance of an image with its own writable filesystem layer. You can create multiple containers from the same image.
What is the purpose of a multi-stage Docker build?
To reduce the final image size by separating build dependencies from the runtime image
Multi-stage builds use multiple FROM statements in a Dockerfile. Build tools and dependencies stay in earlier stages, and only the final artifacts are copied to the runtime stage. This dramatically reduces the final image size (e.g., a Java app: build with Maven/JDK, run with JRE only).
What is the purpose of Docker Compose?
To define and run multi-container Docker applications using a YAML configuration file
Docker Compose uses a docker-compose.yml file to define multi-container applications. It allows you to configure services, networks, and volumes in one file, then start everything with docker compose up. Ideal for local development environments with multiple interdependent services.
What is a Kubernetes Pod?
The smallest deployable unit in Kubernetes, containing one or more containers that share network and storage
A Pod is the smallest deployable unit in Kubernetes. It encapsulates one or more containers that share the same network namespace (IP address and ports) and can share storage volumes. Pods are typically managed by higher-level controllers like Deployments.
What is a Kubernetes Deployment and how does it differ from a Pod?
A Deployment manages a set of identical Pod replicas, handling scaling, rolling updates, and self-healing
A Deployment is a higher-level controller that manages a ReplicaSet of Pods. It provides declarative updates, rolling deployments, rollbacks, and scaling. Unlike a bare Pod, if a Pod managed by a Deployment fails, the Deployment controller automatically creates a replacement.
What is the difference between a Kubernetes Service of type ClusterIP, NodePort, and LoadBalancer?
ClusterIP: internal only; NodePort: exposes on each node's IP; LoadBalancer: provisions an external cloud load balancer
ClusterIP (default) exposes the service on an internal cluster IP, accessible only within the cluster. NodePort exposes the service on a static port on every node's IP. LoadBalancer extends NodePort by provisioning an external load balancer (e.g., AWS ELB) that routes traffic to the service.
What is a Kubernetes ConfigMap used for?
Storing non-confidential configuration data as key-value pairs that can be consumed by Pods
ConfigMaps store non-confidential configuration data (environment variables, config files, command-line args) separately from container images. Pods can consume ConfigMaps as environment variables, volumes, or command-line arguments. For sensitive data, use Secrets instead.
What is the purpose of a CI/CD pipeline?
To automate the process of building, testing, and deploying code changes
CI/CD (Continuous Integration/Continuous Delivery) pipelines automate the software delivery process. CI automatically builds and tests code on every commit. CD automatically deploys validated changes to staging or production environments, reducing manual errors and accelerating delivery.
What does the chmod 755 command do on a Linux file?
Sets owner to read/write/execute, group and others to read/execute
chmod 755 sets permissions using octal notation: 7 (rwx) for the owner, 5 (r-x) for the group, and 5 (r-x) for others. This is a common permission set for executable scripts and web directories — the owner can modify, everyone else can read and execute.
What does the Linux command ps aux | grep java do?
Lists all running processes and filters for Java processes
ps aux lists all running processes with details (user, PID, CPU, memory). The pipe | sends the output to grep java, which filters for lines containing 'java'. This is a common way to find running Java applications and their process IDs.
What is the difference between git merge and git rebase?
Merge creates a merge commit preserving branch history; rebase replays commits on top of the target branch for a linear history
Git merge creates a merge commit that combines two branches, preserving the full branch history. Git rebase moves (replays) your commits on top of the target branch, creating a cleaner, linear history. Rebase rewrites commit history, so avoid rebasing shared/public branches.
What is the purpose of a .gitignore file?
To specify files and directories that Git should not track or include in commits
A .gitignore file tells Git which files and directories to ignore (not track). Common entries include build artifacts (target/, dist/), dependency directories (node_modules/), IDE files (.idea/, .vscode/), and environment files (.env). It keeps the repository clean.
What is Terraform and what problem does it solve?
An Infrastructure as Code tool that lets you define, provision, and manage cloud resources declaratively
Terraform is an Infrastructure as Code (IaC) tool by HashiCorp. It uses a declarative configuration language (HCL) to define infrastructure resources across multiple cloud providers. Terraform tracks resource state, plans changes, and applies them in the correct order.
What is the difference between terraform plan and terraform apply?
plan shows what changes will be made without applying them; apply actually creates/modifies/destroys resources
terraform plan is a dry run that shows what resources will be created, modified, or destroyed without making changes. terraform apply executes the planned changes. Always run plan before apply to review changes. In CI/CD, you can save a plan file and apply it exactly.
What is Terraform state and why is it important?
Terraform state maps your configuration to real-world resources, enabling change detection and resource tracking
Terraform state (terraform.tfstate) is a JSON file that maps your Terraform configuration to real infrastructure resources. It tracks resource IDs, metadata, and dependencies. Without state, Terraform cannot determine what exists and what needs to change. Remote state backends (S3, Terraform Cloud) enable team collaboration.
What is a Jenkinsfile?
A text file that defines a Jenkins pipeline as code, typically stored in version control
A Jenkinsfile defines a Jenkins pipeline as code using either Declarative or Scripted syntax. It is stored in the project's source control repository, enabling pipeline versioning, code review, and reproducibility. It defines stages like Build, Test, and Deploy.
What is a Jenkins Pipeline's 'agent' directive used for?
To specify where the pipeline or a stage should run (which Jenkins node or Docker container)
The agent directive in a Jenkinsfile specifies where the pipeline or a specific stage runs. Options include any (any available agent), label (agents with a specific label), docker (run inside a Docker container), or none (no global agent, each stage must define its own).
What is an AWS VPC (Virtual Private Cloud)?
A logically isolated virtual network in AWS where you can launch resources with your own IP address range
A VPC is a logically isolated section of the AWS Cloud where you define your own virtual network. You control IP address ranges, subnets, route tables, and network gateways. Resources like EC2 instances, RDS databases, and Lambda functions run within a VPC.
What is the difference between horizontal and vertical scaling?
Horizontal scaling adds more machines (scale out); vertical scaling adds more resources to an existing machine (scale up)
Horizontal scaling (scale out) adds more machines/instances to distribute the load. Vertical scaling (scale up) adds more CPU, RAM, or disk to an existing machine. Horizontal scaling provides better fault tolerance and is preferred for cloud-native applications. Vertical scaling has physical limits.
What is the difference between AWS S3 and EBS?
S3 is object storage accessible via HTTP; EBS is block storage attached to EC2 instances like a virtual hard drive
S3 (Simple Storage Service) is object storage accessed via HTTP APIs — ideal for files, backups, static assets, and data lakes. EBS (Elastic Block Store) provides block-level storage volumes attached to EC2 instances — ideal for databases and application data that needs a filesystem. S3 is virtually unlimited; EBS has a provisioned size.
Take the interactive quiz and get your score with a personalized topic breakdown.
Start the Quiz20 questions · 30 min
Java20 questions · 30 min
Java20 questions · 30 min
Java20 questions · 30 min
Java20 questions · 30 min
Java20 questions · 30 min
Spring Boot20 questions · 30 min
Spring Boot20 questions · 30 min
Spring Boot20 questions · 30 min
Spring Boot20 questions · 30 min
Spring Boot20 questions · 30 min
Spring Boot20 questions · 30 min
Join thousands of developers mastering in-demand skills with Amigoscode. Try it free today.