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
- Your team is facing merge conflicts on the
mainbranch 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 - 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) Usegit rm <file>and thengit commit --amend.
b) Usegit filter-branchorgit rebase -ito interactively rebase and remove the offending commit.
c) Usegit revert <commit-hash>for the commit containing the file.
d) Manually delete the file, then usegit add .andgit commit. - You are working on a feature branch and want to pull the latest changes from the
developbranch. 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 - 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 - 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
- Your Jenkins declarative pipeline is failing during the
Buildstage because a required environment variable$API_KEYis 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 apost { always { ... } }block.
b) In ascript { ... }block within the failing stage.
c) In theenvironment { }section at the pipeline top-level.
d) In aparameters { }block to define it as an input. - A Jenkins pipeline script is stuck in a retry loop inside a
scriptblock. You click “Stop” in the Jenkins UI, but the job does not terminate. Which directive in the Jenkinsfile should you use within theoptionssection 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 { ... } - Your pipeline has a
Teststage that runs unit tests. Even if some tests fail, you want the pipeline to continue to a subsequentCodeAnalysisstage, but you still need to record the test failure. Which directive should you use in theTeststage 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. - You are using a
Jenkinsfilefrom a Multibranch Pipeline. One of the stages, “Deploy to Staging,” should only run for themainanddevelopbranches, not for feature branches. Which directive would you wrap thestage('Deploy to Staging')with to enforce this condition?
a)parallel { ... }
b)when { branch pattern: '^(main|develop)$', comparator: 'REGEXP' }
c)input { ... }
d)tools { ... } - The
postsection 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 thepostsection is designed for this specific scenario?
a)always { ... }
b)success { ... }
c)unstable { ... }
d)changed { ... }
Docker
- 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> - 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 - 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> - 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 - 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
- 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 whenpackage.jsonchanges, not when source code changes. How should you structure yourCOPYinstructions?
a) PlaceCOPY . .as the last instruction.
b) Copypackage.jsonfirst, runnpm install, and then copy the rest of the source code.
c) Use a.dockerignorefile to ignore thenode_modulesdirectory.
d) Use the--no-cacheflag every time you build. - A container running from your image cannot start because it immediately exits. The Dockerfile uses
CMD ["node", "server.js"]but theserver.jsfile has a bug and crashes. How can you override theCMDwhen 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 - 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 runcommand to achieve this?
a) Use the--restart=alwaysflag.
b) Use a Docker Volume by specifying-v my_volume:/app/data.
c) Use theCOPYinstruction in the Dockerfile to copy data into the image.
d) Use theWORKDIRinstruction to change the working directory. - Your Dockerfile uses a base image that runs as the
rootuser. 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 - 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) TheCOPYinstruction is copying unnecessary files.
b) The final stage is not using a small base image likealpine.
c) TheFROMinstruction in the final stage is incorrectly copying artifacts from the wrong build stage.
d) The.dockerignorefile is missing.
Kubectl Commands
- A pod in your Kubernetes cluster is in
Pendingstate. 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 - 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> - 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> - You need to quickly troubleshoot a running pod by gaining interactive shell access to it. The pod’s image includes the
/bin/shshell. 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 - 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 - 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> - A recent Deployment caused an issue, and you need to revert to the previous known-good version immediately. Which
kubectl rolloutcommand 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 - 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 - 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) Usekubectl logson the kube-proxy pod.
b) Usekubectl describe node <node-name>.
c) SSH into the node and runiptables-save | grep <service-ip>.
d) Usekubectl get networkpolicies --all-namespaces. - 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
- You run
terraform planand 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 - After collaborating with your team, you run
terraform planand 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 nowterraform apply -refresh-only)
d)terraform validate - A
terraform applyfails 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) Runterraform planagain.
b) RunTF_LOG=DEBUG terraform apply.
c) Check theterraform.tfstatefile manually.
d) Runterraform console. - You have defined a variable
instance_typein yourvariables.tffile. You want to override its default value for a specificterraform applycommand without modifying any files. How can you achieve this?
a) Use the-varflag:terraform apply -var="instance_type=t2.large".
b) Create aterraform.tfvarsfile.
c) Set an environment variableTF_VAR_instance_type.
d) Edit thevariables.tffile directly. - 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" { ... } - 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 themain.tffile of the root module.
b) In the Terraform Registry page for the specific module.
c) By runningterraform outputon the module directory.
d) In the.terraformdirectory created afterterraform init. - Your Terraform configuration uses a data source to fetch the ID of an existing Azure Virtual Network. However,
terraform planfails because the data source cannot find the VNet. What is the most likely cause?
a) The VNet has not been created yet.
b) Theproviderblock is incorrectly configured.
c) The arguments/filters in thedatablock are incorrect.
d) The state file is locked. - You have made a configuration change that should force a resource to be destroyed and re-created (e.g., changing the
nameof an Azure VM). However,terraform planshows 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 - 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
backendconfiguration 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 - You run
terraform destroybut 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 runterraform destroyagain.
b) Useterraform destroy -force.
c) Useterraform state rmto remove the resource from the state file and then runterraform destroyagain.
d) Useterraform applyto try and fix the dependency.
Integrated Troubleshooting Scenarios
- 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 inImagePullBackOff. What is the most likely cause?
a) The Jenkinsfile has a syntax error.
b) The service principal used by the pipeline does not havepullpermissions on the ACR.
c) Thekubectlversion is incompatible with the Kubernetes cluster.
d) The Dockerfile used aCMDinstruction instead ofENTRYPOINT. - Your Terraform configuration deploys an Azure Kubernetes Service (AKS) cluster and a Helm chart within it. The
terraform applyfor 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 Terraformhelm_releaseresource needs a explicitdepends_onclause referencing the AKS cluster.
b) The Kubernetes provider block needs to be configured using the AKS cluster’s outputs (likehost,client_certificate,client_key, andcluster_ca_certificate).
c) The Helm chart is broken.
d) You need to runterraform initagain. - 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) Thekubectlcommand used to deploy the pod was incorrect.
d) The image was not pushed to the registry correctly. - Your Jenkins pipeline uses a
docker buildcommand. 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 DockerfileFROMinstruction to a different base image.
d) Use thedocker --tlsverifyflag in the pipeline. - After a
terraform applythat 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) Runterraform destroyand recreate everything.
b) Usekubectl describe podto check the pod’s events.
c) Useterraform state listto see all managed resources.
d) Runterraform applyagain with the previous configuration to revert the change. - You are setting up a new Azure DevOps project. Your Terraform pipeline fails at the
initstage 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 Terraformbackendblock?
a) Theresource_group_nameandstorage_account_nameare incorrect.
b) You are using alocalbackend instead of anazurermbackend.
c) The Azure DevOps service connection does not have the ‘Contributor’ role.
d) Thekeyfor the state file is missing. - In a Jenkins Pipeline, you are using a
shstep to runkubectl 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 filedeployment.yamlwas identical to the live configuration, so no changes were applied.
b) Thekubectlcommand 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. - Your Docker container, which runs a web application, fails health checks in Kubernetes. The
kubectl describe podshowsLiveness probe failed. You cankubectl execinto the pod and manually curl the health check endpoint successfully. What is a potential reason for the discrepancy?
a) ThelivenessProbein the deployment YAML is configured with an incorrectpath,port, orinitialDelaySeconds.
b) The pod has insufficient CPU resources.
c) Thekubectlcommand is using a different network.
d) The node is running an outdated version of Docker. - You have a Terraform module that creates an Azure App Service. You want to ensure that every time the App Service’s
app_settingsare modified, the resource is forced to be replaced. Which meta-argument should you use in theresourceblock for the App Service?
a)depends_on
b)count
c)lifecycle { ignore_changes = ... }
d)lifecycle { create_before_destroy = true } - A Jenkins pipeline is designed to run
terraform planand leave a comment on a pull request. Theplanoutput is very long and gets truncated in the comment. Which Terraform command-line option can you use withterraform planto 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.

Cybersecurity Architect | Cloud-Native Defense | AI/ML Security | DevSecOps
With over 23 years of experience in cybersecurity, I specialize in building resilient, zero-trust digital ecosystems across multi-cloud (AWS, Azure, GCP) and Kubernetes (EKS, AKS, GKE) environments. My journey began in network security—firewalls, IDS/IPS—and expanded into Linux/Windows hardening, IAM, and DevSecOps automation using Terraform, GitLab CI/CD, and policy-as-code tools like OPA and Checkov.
Today, my focus is on securing AI/ML adoption through MLSecOps, protecting models from adversarial attacks with tools like Robust Intelligence and Microsoft Counterfit. I integrate AISecOps for threat detection (Darktrace, Microsoft Security Copilot) and automate incident response with forensics-driven workflows (Elastic SIEM, TheHive).
Whether it’s hardening cloud-native stacks, embedding security into CI/CD pipelines, or safeguarding AI systems, I bridge the gap between security and innovation—ensuring defense scales with speed.
Let’s connect and discuss the future of secure, intelligent infrastructure.