Top 15 Azure DevOps Scenario-based Interview Questions and Solutions

Piyush Sachdeva
6 min readApr 12, 2024

--

Introduction 👨🏼‍💻

This blog is part of the Azure DevOps Zero to Hero YouTube series. The series includes 17 beginner-friendly videos featuring concepts, demos, real-time projects, and hands-on experience. The blog should be referred to as a last-minute interview preparation guide. Make sure you have completed the entire hands-on playlist. Link here:➡️ Playlist

If you prefer a thorough explanation of these interview questions, I recommend watching the video below. Otherwise, you can continue with the blog.

Question 1. Explain a typical structure of an Azure DevOps YAML Pipeline.

You can start with the overall structure of the pipeline, starting with the trigger. Optionally, you can explain the different types of stages it could have: build, test, scan, deploy, etc.

A Sample Azure DevOps YAML Pipeline Structure( Image Source)
  • A trigger tells a Pipeline to run. It could be CI or Scheduled, manual(if not specified), or after another build finishes.
  • A pipeline consists of stages and can be deployed to one or more environments.
  • A stage organizes jobs in a pipeline, and each stage can have one or more jobs.
  • Each job runs on one agent, such as Ubuntu, Windows, macOS, etc. A job can also be agentless.
  • Each agent runs a job that contains one or more steps.
  • A step can be a task or script and is the smallest building block of a pipeline.
  • A task is a pre-packaged script that acts, such as invoking a REST API or publishing a build artifact.
  • An artifact is a collection of files or packages published by a run.

Question 2: Which Deployment Strategy are you using in your organization? Explain the CICD flow:

You can explain the Blue-Green Deployment Strategy if you are not comfortable with any deployment strategy.

Image showing how Blue Green Deployment works in Azure DevOps

You can also explain the below CICD flow for Blue-Green Deployment using Azure DevOps to an Azure Web App

Sample CICD flow of Azure DevOps pipeline for Azure Web App that uses a Blue-Green deployment strategy

Question 3: What are some other deployment strategies?

You can explain the below deployment strategies as well:

Canary release

  • Canary is a technique to reduce the risk of introducing a new software version in production by slowly rolling out the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody.
  • Like a Blue-Green Deployment, you start by deploying the new version of your software to a subset of your infrastructure to which no users are routed.
  • When you are happy with the new version, you can start routing a few selected users to it

A/B Testing

  • Similar to the Canary release, however, in A/B testing, you can also route the user traffic based on routing rules that often include factors such as browser version, user agent, geolocation, and operating system. After measuring and comparing the versions, you update the production environment with the version that yielded better results.

Rolling Update

  • In a rolling deployment, you simultaneously change an instance or batch of instances. In the three-tiered web application example, UI changes will first be deployed to one instance, and once that is complete, they will be repeated on the other.

Question 4: Which Build repository have you used with Azure DevOps? Explain the CICD flow:

You can explain any build repositories that you have worked with, such as Artifactory, Nexus, Docker registry, etc., or you can explain the In-built Azure DevOps repository, which is called Artifacts. You can explain the below CICD flow:

Sample Azure DevOps CICD flow with Artifacts

Question 5: What are the views in an Artifacts feed?

An isolated placeholder in a repository can be categorized into Local, pre-release, Release, etc. Once your Artifacts are deployed to one environment, you promote them to another view to be deployed in another environment, with that view being the trigger. The above example can help explain that.

Question 6: How would you use IaaC tools such as ARM Template or Terraform to automate Infra provisioning?

You can explain the below CICD flow

Sample CICD flow showing Azure DevOps integration with Terraform

Question 7: What is the difference between Microsoft-hosted agents and self-hosted agents?

Start by providing at least one use case of each and explain the difference as per the below image:

Sample image showing Microsoft-hosted vs self-hosted agents

Question 8: If Microsoft has already provided you with hosted agents, why would you set up self-hosted agents?

Start by explaining the features of self-hosted agents and why it is best fit for a production server or your critical workloads.

Microsoft self-hosted agents benefits and setup

Question 9: Are there any other limitations of Microsoft-hosted agents?

There could be many limitations, such as below:

  • No custom installation of packages/software
  • Sometimes, you have to wait for the agent to become available, which causes delays in pipeline execution.
  • It comes with pre-defined storage, memory, and CPU, which is insufficient for executing a memory- or CPU-extensive build pipeline.
  • You cannot harden the security of Microsoft-hosted agents.

Question 10: I am building a Docker image that is taking a long time and is huge. How can I reduce the image size and speed up the process?

Explain the multi-stage build. Below is a sample docker file snippet.

FROM node:18-alpine AS installer
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:latest AS deployer
COPY --from=installer /app/build /usr/share/nginx/html

Question 11: Explain some of the Azure DevOps Best Practices:

Checkout the video below for the best practices:

Question 12: How can you ensure the security and privacy of secrets used in your pipeline to prevent their exposure?

You can explain various methods using which you can implement secret management in Azure DevOps, such as:

  • By using Azure Key Vault and access via a variable group.
  • Using the Runtime variable, tokenize your files and replace the token step inside the pipeline.
  • By using Third-party secret management services such as Hashicorp Vault

Question 13: What is the most difficult issue you have faced while working with Azure DevOps?

Pick up the issue you have faced while doing hands-on on Azure DevOps if you have followed this series or any other resource.

Structure your answer in STAR format: S: Situation, T: Task, A: Action, R: Result.

If you have not followed the hands-on demo or you do not have enough time to practice, I would recommend checking out the video below:

Question 14: How would you implement CICD for a container-based application?

You can start by explaining the process that starts with dockerizing the application. You can include a multi-stage build, then the creation of a CICD pipeline to deploy to a managed container service such as Azure Container Instance(ACI), below video has end-to-end implementation with the help of a realtime project:

Question 15: How would you implement CICD for a microservice-based application with multiple services?

Watch the video below, which shows the end-to-end implementation of deploying the application to a Kubernetes cluster(AKS).

Conclusion:

While the list is exhaustive, these are the important questions that cover many scenarios concerning Azure DevOps, IaaC, Containers, Kubernetes, Security, Best practices, CICD, Build, Release, deployments, and overall understanding of DevOps concepts. I recommend going through the entire playlist and performing the hands-on by following the videos.

If you have any questions or are stuck somewhere, we have an amazing Discord community available to help you. Join our Discord channel below(Free, of course). You can ask about your query/issues in the az-DevOps-help channel, and someone will help you.

Discord channel link: https://discord.gg/FMtJ2bVRUE

References:

--

--