DevOps Engineer 1โ3 Years Experience Interview Questions and Answers
If you’re preparing for a DevOps Engineer interview, this article can help you understand the types of questions that are being asked in real interviews today.
We have compiled these DevOps Engineer interview questions based on feedback and experiences shared by candidates with 1 to 3 years of experience. We have included 3 to 4 interview questions from each major DevOps technology, including Kubernetes, Terraform, AWS, Git, CI/CD, and Shell Scripting. And along with each question, you’ll find a simple explanation and interview-focused answer to help you understand the concept better and build confidence before your next interview.
Before going through the questions, here’s a small challenge for you.
Read each question carefully and try to answer it on your own before clicking on “Click Here for Answer”. This will help you test your knowledge, identify areas where you need improvement, and build confidence for your upcoming DevOps interviews.
Let’s see how many questions you can answer correctly!
Kubernetes
1. How do you separate environments like Dev, Staging, and Prod in Kubernetes?
Click here for Answer
In smaller organizations, environments are often separated using Kubernetes Namespaces within the same cluster. In larger production environments, separate clusters are usually used for better isolation and security. For example, we might have separate clusters for Dev, Staging, and Production while using namespaces inside each cluster for application separation.
2. What is the purpose of a ServicePort in Kubernetes?
Click here for Answer
A ServicePort defines the port through which a Kubernetes Service exposes an application. It acts as an entry point and forwards traffic to the target port running inside the pods.
3. What is a Deployment in Kubernetes?
Click here for Answer
A Deployment is a Kubernetes object used to manage stateless applications. It ensures the desired number of pod replicas are running and handles rolling updates, rollbacks, and self-healing when pods fail.
AWS
1. Difference between EC2 and Fargate?
Click here for Answer
EC2 gives us full control over virtual machines, including operating system management. Fargate is serverless for containers, so AWS manages the underlying infrastructure and we only focus on running containers.
2. Explain Route 53 Routing Policies.
Click here for Answer
Simple Routing: Routes traffic to a single resource.
Weighted Routing: Distributes traffic based on assigned weights.
Latency Routing: Sends users to the lowest latency endpoint.
Failover Routing: Redirects traffic to a backup resource during failures.
Geolocation Routing: Routes based on user location.
Multi-Value Routing: Returns multiple healthy endpoints.
3. What is Rotation Policy in AWS KMS?
Click here for Answer
A rotation policy automatically rotates encryption keys periodically. This improves security because old keys are replaced with new versions while maintaining access to encrypted data.
4. Main parameters used in Auto Scaling?
Click here for Answer
Minimum Capacity, Maximum Capacity, Desired Capacity, Scaling Policies, Health Checks, Cooldown Periods, these are main parameters in Auto Scaling because, these settings determine how instances are added or removed based on demand.
Terraform
1. What is depends_on in Terraform?
Click here for Answer
depends_on explicitly defines a dependency between resources. Terraform ensures the dependent resource is created only after the specified resource is successfully created.
2. How do you view outputs in Terraform?
Click here for Answer
After deployment, outputs can be viewed using ” terraform output output_name “
3. What is terraform taint?
Click here for Answer
terraform taint marks a resource for recreation during the next terraform apply. It is useful when a resource becomes corrupted or needs replacement without changing the Terraform code.
Docker
1. What is Docker Compose?
Click here for Answer
Docker Compose allows us to define and run multiple containers using a single YAML file. It is commonly used for local development environments where applications require databases, APIs, and other services.
2. How can multiple containers run on the same port?
Click here for Answer
Multiple containers cannot directly use the same host port. Usually a reverse proxy or load balancer such as Nginx, Traefik, or HAProxy receives traffic on one port and forwards requests to different containers internally.
3. What is EXPOSE in a Dockerfile?
Click here for Answer
The EXPOSE instruction documents which port the container application listens on. It does not publish the port automatically but serves as metadata for users and tools.
4. How do you handle multiple Python versions or base image versions?
Click here for Answer
I usually create separate Dockerfiles or use build arguments.
Example:
ARG PYTHON_VERSION=3.11
FROM python:${PYTHON_VERSION}
This allows different versions to be selected during the build process.
Linux & Scripting
1. What does chmod 777 do?
Click here for Answer
chmod 777 gives read, write, and execute permissions to everyone: owner, group, and others.
2. What is 5777?
Click here for Answer
The number 5 at the beginning represents special permissions.
5 = SetUID (4) + Sticky Bit (1)
777 still means full permissions for owner, group, and others.
3. Which command is used to substitute a string?
Click here for Answer
The sed command is commonly used.
Example:
sed -i ‘s/oldtext/newtext/g’ file.txt
4. How do you search for a word using grep?
Click here for Answer
Example:
grep “error” application.log
This searches for the word “error” inside the file.
CI/CD & Git
1. How do you create parallel stages in Jenkins?
Click here for Answer
Parallel stages allow multiple tasks to run simultaneously.
Like, unit testing, security scanning, and code quality checks can run in parallel to reduce pipeline execution time.
2. Difference between git merge and git rebase?
Click here for Answer
git merge combines branches and preserves history.
git rebase moves commits onto another branch and creates a cleaner linear history.
3. What is staging in Git?
Click here for Answer
Staging is the intermediate area where changes are prepared before committing.
Using this command you can add file to the staging area:
git add file.txt
4. What is Blue-Green Deployment?
Click here for Answer
Blue-Green Deployment uses two identical environments.
Blue = Current Production
Green = New Version
Traffic is switched from Blue to Green after successful testing, reducing downtime and making rollback easier.
5. What is git stash?
Click here for Answer
git stash temporarily saves uncommitted changes without committing them. It is useful when switching branches or pulling updates without losing work.
6. What is git commit? Will commit IDs remain the same after rebase?
Click here for Answer
git commit saves changes to the repository history. And No, commit IDs usually change after a rebase because Git rewrites the commit history and creates new commit hashes.
Congratulations on completing the quiz!
If you scored all 25 out of 25, that’s excellent. If your score is anywhere between 18 and 24, that’s still a very good result and shows that you have a solid understanding of DevOps concepts.
If you scored lower than expected, don’t get discouraged. Use the questions you missed as a learning opportunity, strengthen your fundamentals, and keep practicing. Consistency is more important than perfection, and every interview preparation session brings you one step closer to your goal.
Keep learning, keep building projects, and most importantly, don’t break your momentum.
From all of us at PrepForCareers.com, we wish you the very best in your DevOps career and upcoming interviews!
We hope this article helps you better prepare for your next DevOps Engineer interview. The questions and answers shared here are based on real interview experiences, industry knowledge, and commonly discussed DevOps concepts.
If you have any questions, feedback, or additional interview questions to share, feel free to leave a comment or get in touch with us through our Contact Us page.
