Free DevOps Test Series for working Professionals – November 2025

Welcome to this comprehensive assessment designed to evaluate and strengthen your troubleshooting expertise as an Azure DevOps professional. In real-world DevOps environments, success isn’t just about knowing commands—it’s about understanding complex scenarios, diagnosing failures across interconnected systems, and applying the right solution under pressure.

This collection of 50 scenario-based multiple-choice questions plunges you into the typical challenges you’ll face when working with Git, Jenkins, Docker, Kubernetes, and Terraform. Each question presents a detailed, two-to-three-sentence problem description that mirrors actual operational issues, from debugging a failing Jenkins pipeline and diagnosing a crashing container to unraveling a Terraform state deadlock and troubleshooting a misconfigured Kubernetes service.

Your task is to cut through the noise, identify the root cause, and select the most effective resolution. This test moves beyond simple command recall, focusing instead on the practical application and contextual understanding that separates a proficient practitioner from a true expert. Ready to put your skills to the test? Let’s begin.

Git Commands

  1. Your team is facing merge conflicts on the main branch after a pull request was completed. The conflicts are in multiple files. To ensure you understand all the changes before manually resolving, which command will show you the current state, including which files are conflicted and the sections of conflict within each file?
    a) git status
    b) git log --oneline
    c) git diff
    d) git merge --abort
  2. A developer accidentally committed sensitive credentials in a file two commits ago in the branch’s history. They have not pushed the changes to the remote repository yet. Which sequence of actions is the safest to completely remove the file from the Git history without creating a new commit that just deletes it?
    a) Use git rm <file> and then git commit --amend.
    b) Use git filter-branch or git rebase -i to interactively rebase and remove the offending commit.
    c) Use git revert <commit-hash> for the commit containing the file.
    d) Manually delete the file, then use git add . and git commit.
  3. You are working on a feature branch and want to pull the latest changes from the develop branch. However, you have local uncommitted changes that you are not ready to commit. Which command allows you to temporarily stash your local changes, update your branch, and then reapply your changes?
    a) git branch --force
    b) git stash
    c) git checkout -- .
    d) git fetch --all
  4. After resolving all merge conflicts in your files, the merge process is still in progress and Git is waiting for you to finalize it. Which command must you run to create the merge commit and complete the merge operation?
    a) git add .
    b) git commit -m "Merge conflict resolved"
    c) git merge --continue
    d) git push origin HEAD
  5. A junior developer created a series of commits with poorly written messages. Before pushing to the remote, they want to reword the commit messages from the last three commits. Which interactive command should they use to modify the history of their current branch?
    a) git commit --amend
    b) git rebase -i HEAD~3
    c) git log --oneline
    d) git cherry-pick

Jenkins Pipeline

  1. Your Jenkins declarative pipeline is failing during the Build stage because a required environment variable $API_KEY is not set. You want to ensure the pipeline fails early with a clear message if this variable is missing. Where in the pipeline structure would you most appropriately place this check?
    a) Inside a post { always { ... } } block.
    b) In a script { ... } block within the failing stage.
    c) In the environment { } section at the pipeline top-level.
    d) In a parameters { } block to define it as an input.
  2. A Jenkins pipeline script is stuck in a retry loop inside a script block. You click “Stop” in the Jenkins UI, but the job does not terminate. Which directive in the Jenkinsfile should you use within the options section or the stage to enforce a time limit and automatically abort the pipeline after a specified duration?
    a) retry(3)
    b) timeout(time: 15, unit: 'MINUTES')
    c) waitUntil { ... }
    d) input { ... }
  3. Your pipeline has a Test stage that runs unit tests. Even if some tests fail, you want the pipeline to continue to a subsequent CodeAnalysis stage, but you still need to record the test failure. Which directive should you use in the Test stage to control this behavior?
    a) post { failure { ... } }
    b) agent any
    c) when { expression { ... } }
    d) catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') or a similar post-condition check.
  4. You are using a Jenkinsfile from a Multibranch Pipeline. One of the stages, “Deploy to Staging,” should only run for the main and develop branches, not for feature branches. Which directive would you wrap the stage('Deploy to Staging') with to enforce this condition?
    a) parallel { ... }
    b) when { branch pattern: '^(main|develop)$', comparator: 'REGEXP' }
    c) input { ... }
    d) tools { ... }
  5. The post section in your Jenkins pipeline is used for sending notifications. You want to send a Slack message only if the pipeline’s overall status is unstable (e.g., due to test failures), but not if it fails or succeeds. Which condition block inside the post section is designed for this specific scenario?
    a) always { ... }
    b) success { ... }
    c) unstable { ... }
    d) changed { ... }

Docker

  1. You suspect a Docker container running your application is consuming an excessive amount of memory. Which command will show you the live resource usage statistics, including CPU, memory, and network I/O, for all running containers?
    a) docker ps
    b) docker stats
    c) docker logs <container_id>
    d) docker inspect <container_id>
  2. An application inside a Docker container is failing, and you need to examine its standard output and error logs to diagnose the issue. Which command will stream the logs from a specific container to your terminal?
    a) docker exec -it <container_id> /bin/bash
    b) docker attach <container_id>
    c) docker logs -f <container_id>
    d) docker info
  3. You have a running container, and you need to execute an interactive shell inside it to check the contents of a configuration file and run some diagnostic commands. Which command will give you this shell access?
    a) docker run -it <image_name> /bin/bash
    b) docker exec -it <container_id> /bin/bash
    c) docker start -ai <container_id>
    d) docker commit <container_id>
  4. Over time, your Docker host has accumulated many stopped containers, unused networks, and dangling images, consuming disk space. Which command will remove all these resources that are not in use?
    a) docker rm $(docker ps -aq)
    b) docker system prune -f
    c) docker image prune
    d) docker volume ls
  5. You are trying to build a new Docker image, but the build is failing because the Dockerfile is trying to copy a file that does not exist in the build context. Which command builds an image and provides more verbose output, which can help you see the build context and each step being executed?
    a) docker build --no-cache -t my-app .
    b) docker build --progress=plain -t my-app .
    c) docker image ls
    d) docker history my-app

Dockerfile

  1. Your Docker image build is slow because the COPY . . instruction invalidates the cache for all subsequent layers whenever any file changes. You want to optimize the build by only invalidating the cache for dependency installation when package.json changes, not when source code changes. How should you structure your COPY instructions?
    a) Place COPY . . as the last instruction.
    b) Copy package.json first, run npm install, and then copy the rest of the source code.
    c) Use a .dockerignore file to ignore the node_modules directory.
    d) Use the --no-cache flag every time you build.
  2. A container running from your image cannot start because it immediately exits. The Dockerfile uses CMD ["node", "server.js"] but the server.js file has a bug and crashes. How can you override the CMD when running the container to start a shell instead and keep the container alive for troubleshooting?
    a) docker run -it --entrypoint /bin/bash my-image
    b) docker run -d my-image /bin/bash
    c) docker run my-image --cmd /bin/bash
    d) docker exec -it <container_id> /bin/bash
  3. Your application inside the container needs to write files to the filesystem. However, when the container is restarted, all the written data is lost. You want to persist data generated by the container beyond its lifecycle. Which method should you use in your docker run command to achieve this?
    a) Use the --restart=always flag.
    b) Use a Docker Volume by specifying -v my_volume:/app/data.
    c) Use the COPY instruction in the Dockerfile to copy data into the image.
    d) Use the WORKDIR instruction to change the working directory.
  4. Your Dockerfile uses a base image that runs as the root user. For security reasons, you want your application to run as a non-privileged user. Which instruction in the Dockerfile should you use to switch the user context for the rest of the build and the runtime?
    a) USER myuser
    b) RUN useradd myuser
    c) WORKDIR /home/myuser
    d) ENV USER=myuser
  5. A multi-stage Dockerfile is used to build a Go application. The final image is still very large because it includes build tools from the first stage. What is the most likely cause of this issue?
    a) The COPY instruction is copying unnecessary files.
    b) The final stage is not using a small base image like alpine.
    c) The FROM instruction in the final stage is incorrectly copying artifacts from the wrong build stage.
    d) The .dockerignore file is missing.

Kubectl Commands

  1. A pod in your Kubernetes cluster is in Pending state. You need to find out why the scheduler cannot assign it to a node, perhaps due to insufficient resources or node selector mismatches. Which command will provide the most detailed information about the pod’s events and conditions?
    a) kubectl get pods
    b) kubectl describe pod <pod-name>
    c) kubectl logs <pod-name>
    d) kubectl get events --all-namespaces
  2. You have updated a Deployment’s container image tag. The rollout is stuck, and new pods are not becoming ready. You want to see the rollout status and see if there are any issues with the new ReplicaSet. Which command provides a real-time status of the rollout?
    a) kubectl get deployments
    b) kubectl rollout status deployment/<deployment-name>
    c) kubectl get rs
    d) kubectl edit deployment/<deployment-name>
  3. A pod is running but the application inside is crashing and restarting repeatedly. You want to see the logs from the most recently crashed container instance to understand the error. Which command will fetch the logs from the previous container instance?
    a) kubectl logs <pod-name>
    b) kubectl logs -f <pod-name>
    c) kubectl logs --previous <pod-name>
    d) kubectl describe pod <pod-name>
  4. You need to quickly troubleshoot a running pod by gaining interactive shell access to it. The pod’s image includes the /bin/sh shell. Which command is the correct way to get an interactive shell session?
    a) kubectl attach pod <pod-name> -i -t
    b) kubectl exec -it <pod-name> -- /bin/sh
    c) kubectl run -it --image=busybox --rm debug-pod
    d) kubectl port-forward <pod-name> 8080:80
  5. You suspect a configuration issue with a specific node in your cluster. You want to get a detailed, JSON-formatted description of the node, including its capacity, allocatable resources, conditions, and taints. Which command will output this information?
    a) kubectl get nodes
    b) kubectl top node <node-name>
    c) kubectl describe node <node-name>
    d) kubectl get node <node-name> -o json
  6. A service is not routing traffic to its backend pods correctly. You want to see the endpoints (the IPs of the pods) that the service is targeting. Which command will show you the endpoints associated with a service?
    a) kubectl get services
    b) kubectl describe service <service-name>
    c) kubectl get endpoints <service-name>
    d) kubectl get pods -l <service-selector-label>
  7. A recent Deployment caused an issue, and you need to revert to the previous known-good version immediately. Which kubectl rollout command will undo the last deployment, effectively performing a rollback?
    a) kubectl rollout pause deployment/<name>
    b) kubectl rollout history deployment/<name>
    c) kubectl rollout undo deployment/<name>
    d) kubectl apply -f previous-deployment.yaml
  8. You have a YAML manifest for a resource, but you want to modify it slightly and re-apply it without using an editor. Which command will allow you to temporarily set the number of replicas for a deployment to 5 without permanently editing the YAML file?
    a) kubectl edit deployment <name>
    b) kubectl scale deployment <name> --replicas=5
    c) kubectl patch deployment <name> -p '{"spec":{"replicas":5}}'
    d) kubectl apply -f deployment.yaml
  9. You are debugging a network policy issue and want to check the current network rules (iptables) on a specific node. Which method is the most direct way to inspect this, assuming you have SSH access to the node?
    a) Use kubectl logs on the kube-proxy pod.
    b) Use kubectl describe node <node-name>.
    c) SSH into the node and run iptables-save | grep <service-ip>.
    d) Use kubectl get networkpolicies --all-namespaces.
  10. A pod is failing to pull an image from a private container registry. You have created a Secret with the registry credentials. Which command would you use to verify that the Secret was created correctly and contains the expected data?
    a) kubectl get secrets
    b) kubectl describe secret <secret-name>
    c) kubectl get secret <secret-name> -o yaml
    d) kubectl logs <pod-name>

Terraform

  1. You run terraform plan and receive an error that an Azure Resource Group name is already in use. You realize you should import the existing resource into your Terraform state instead of creating a new one. Which command is used to adopt an existing infrastructure resource into your Terraform state?
    a) terraform refresh
    b) terraform import azurerm_resource_group.my_rg /subscriptions/.../resourceGroups/my-rg
    c) terraform state rm azurerm_resource_group.my_rg
    d) terraform taint azurerm_resource_group.my_rg
  2. After collaborating with your team, you run terraform plan and see unexpected changes to resources you didn’t modify. You suspect the state file is out of sync with the real infrastructure. Which command will reconcile the state Terraform knows about with the real-world infrastructure without making any changes?
    a) terraform apply
    b) terraform destroy
    c) terraform refresh (Note: In newer versions, this is now terraform apply -refresh-only)
    d) terraform validate
  3. terraform apply fails partway through, destroying a virtual machine but failing to create a new disk. The state is now inconsistent. Which command should you use first to get a detailed, step-by-step log of the operations to pinpoint the exact failure?
    a) Run terraform plan again.
    b) Run TF_LOG=DEBUG terraform apply.
    c) Check the terraform.tfstate file manually.
    d) Run terraform console.
  4. You have defined a variable instance_type in your variables.tf file. You want to override its default value for a specific terraform apply command without modifying any files. How can you achieve this?
    a) Use the -var flag: terraform apply -var="instance_type=t2.large".
    b) Create a terraform.tfvars file.
    c) Set an environment variable TF_VAR_instance_type.
    d) Edit the variables.tf file directly.
  5. You need to output the IP address of a newly created Azure VM to a file for another script to use. Which Terraform configuration block allows you to export specific values from your state after an apply?
    a) variable "vm_ip" { ... }
    b) resource "azurerm_public_ip" "vm" { ... }
    c) output "vm_ip_address" { value = azurerm_public_ip.vm.ip_address }
    d) data "azurerm_public_ip" "vm" { ... }
  6. You are using a module from the Terraform Registry to create an Azure AKS cluster. You need to understand the output values that the module provides so you can use them in your root module. Where is the best place to find this documentation?
    a) In the main.tf file of the root module.
    b) In the Terraform Registry page for the specific module.
    c) By running terraform output on the module directory.
    d) In the .terraform directory created after terraform init.
  7. Your Terraform configuration uses a data source to fetch the ID of an existing Azure Virtual Network. However, terraform plan fails because the data source cannot find the VNet. What is the most likely cause?
    a) The VNet has not been created yet.
    b) The provider block is incorrectly configured.
    c) The arguments/filters in the data block are incorrect.
    d) The state file is locked.
  8. You have made a configuration change that should force a resource to be destroyed and re-created (e.g., changing the name of an Azure VM). However, terraform plan shows no change. Which command can you use to manually mark a resource for destruction and recreation in the next plan/apply cycle?
    a) terraform destroy -target=azurerm_virtual_machine.my_vm
    b) terraform state rm azurerm_virtual_machine.my_vm
    c) terraform taint azurerm_virtual_machine.my_vm
    d) terraform refresh
  9. Your team has grown, and you need to store the Terraform state file in a remote backend (like Azure Storage Account) to allow collaboration and state locking. After adding the backend configuration block, what is the critical next command you must run to migrate the local state to the remote backend?
    a) terraform plan
    b) terraform apply
    c) terraform init
    d) terraform refresh
  10. You run terraform destroy but it fails because an associated Azure Network Security Group has a dependency that is not correctly managed in the state. The destroy is halted. What is the safest next step to force the destruction of the specific resource and then retry?
    a) Manually delete the resource from the Azure Portal and run terraform destroy again.
    b) Use terraform destroy -force.
    c) Use terraform state rm to remove the resource from the state file and then run terraform destroy again.
    d) Use terraform apply to try and fix the dependency.

Integrated Troubleshooting Scenarios

  1. In your Azure DevOps pipeline, a Jenkins build job successfully creates a Docker image and pushes it to Azure Container Registry (ACR). The subsequent deployment stage, which uses kubectl set image, fails. The old pods terminate but the new pods are stuck in ImagePullBackOff. What is the most likely cause?
    a) The Jenkinsfile has a syntax error.
    b) The service principal used by the pipeline does not have pull permissions on the ACR.
    c) The kubectl version is incompatible with the Kubernetes cluster.
    d) The Dockerfile used a CMD instruction instead of ENTRYPOINT.
  2. Your Terraform configuration deploys an Azure Kubernetes Service (AKS) cluster and a Helm chart within it. The terraform apply for the AKS cluster succeeds, but the Helm release fails. The error message indicates the Kubernetes provider cannot connect to the cluster. What is the missing step in your configuration?
    a) The Terraform helm_release resource needs a explicit depends_on clause referencing the AKS cluster.
    b) The Kubernetes provider block needs to be configured using the AKS cluster’s outputs (like hostclient_certificateclient_key, and cluster_ca_certificate).
    c) The Helm chart is broken.
    d) You need to run terraform init again.
  3. A developer reports that their code, which worked locally in a Docker container, is failing in the Kubernetes cluster. The pod logs show “File Not Found” for a configuration file. You check the Dockerfile and see it uses COPY config.json /app/. What is a likely difference between the local and cluster environments causing this issue?
    a) The Kubernetes node is out of disk space.
    b) The container in Kubernetes is running as a non-root user that doesn’t have read permissions for /app/config.json.
    c) The kubectl command used to deploy the pod was incorrect.
    d) The image was not pushed to the registry correctly.
  4. Your Jenkins pipeline uses a docker build command. The build fails with a message “Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”. This pipeline is running on a Jenkins agent node. What is the most probable solution?
    a) Install Docker on the Jenkins controller.
    b) Ensure the Jenkins agent is configured with a volume mount that exposes the host’s Docker socket: -v /var/run/docker.sock:/var/run/docker.sock.
    c) Change the Dockerfile FROM instruction to a different base image.
    d) Use the docker --tlsverify flag in the pipeline.
  5. After a terraform apply that modified a Network Security Group rule, a pod in your AKS cluster loses connectivity to a dependent database. The Terraform plan succeeded. What is the fastest way to check if the recent Terraform change is the root cause?
    a) Run terraform destroy and recreate everything.
    b) Use kubectl describe pod to check the pod’s events.
    c) Use terraform state list to see all managed resources.
    d) Run terraform apply again with the previous configuration to revert the change.
  6. You are setting up a new Azure DevOps project. Your Terraform pipeline fails at the init stage with an error about an “unsupported backend type”. You are using an Azure Storage Account for your backend. What is the most likely misconfiguration in your Terraform backend block?
    a) The resource_group_name and storage_account_name are incorrect.
    b) You are using a local backend instead of an azurerm backend.
    c) The Azure DevOps service connection does not have the ‘Contributor’ role.
    d) The key for the state file is missing.
  7. In a Jenkins Pipeline, you are using a sh step to run kubectl apply -f deployment.yaml. The step passes, but you find out the deployment was never updated. Looking at the pipeline log, you see the message: “deployment.apps/my-app configured”. What is the most likely explanation?
    a) The YAML file deployment.yaml was identical to the live configuration, so no changes were applied.
    b) The kubectl command failed silently.
    c) The Jenkins agent does not have network access to the Kubernetes API.
    d) The Docker image used in the deployment does not exist.
  8. Your Docker container, which runs a web application, fails health checks in Kubernetes. The kubectl describe pod shows Liveness probe failed. You can kubectl exec into the pod and manually curl the health check endpoint successfully. What is a potential reason for the discrepancy?
    a) The livenessProbe in the deployment YAML is configured with an incorrect pathport, or initialDelaySeconds.
    b) The pod has insufficient CPU resources.
    c) The kubectl command is using a different network.
    d) The node is running an outdated version of Docker.
  9. You have a Terraform module that creates an Azure App Service. You want to ensure that every time the App Service’s app_settings are modified, the resource is forced to be replaced. Which meta-argument should you use in the resource block for the App Service?
    a) depends_on
    b) count
    c) lifecycle { ignore_changes = ... }
    d) lifecycle { create_before_destroy = true }
  10. A Jenkins pipeline is designed to run terraform plan and leave a comment on a pull request. The plan output is very long and gets truncated in the comment. Which Terraform command-line option can you use with terraform plan to output the plan to a file in a more structured format that can be parsed and displayed correctly?
    a) terraform plan -out=plan.tfplan
    b) terraform plan -detailed-exitcode
    c) terraform plan -lock=false
    d) terraform plan -no-color > plan.txt

Conclusion: Your Journey to DevOps Mastery Continues Here

Navigating through these 50 complex scenarios has likely highlighted a fundamental truth of modern IT: true expertise lies not just in knowing commands, but in understanding how to troubleshoot and orchestrate entire systems under real-world constraints. The path to mastering technologies like Git, Jenkins, Docker, Kubernetes, and Terraform is continuous, filled with new challenges and learning opportunities at every turn.

If this assessment ignited your curiosity or revealed areas you’d like to strengthen, you don’t have to navigate this journey alone. AEM Institute is committed to being your partner in professional growth. We believe in empowering the next generation of IT talent by breaking down barriers to education.

That’s why we offer a comprehensive library of free, high-quality tutorials, guides, and hands-on labs designed specifically for students and professionals like you. Whether you are taking your first steps in Azure DevOps or preparing for a senior-level certification, our resources are built to provide the clarity and depth you need to succeed.

Visit the AEM Institute today and transform your potential into expertise. Let’s build the future of technology, together.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!
Scroll to Top