AZ-400 DevOps Engineer Expert Practice Questions with Explanations
Free AZ-400 Azure DevOps Engineer Expert practice questions with an explanation for every answer. Covers source control, CI/CD pipelines, infrastructure as code, testing, monitoring, and security in DevOps.
Questions
In GitHub Flow, where is new work done before it reaches main?
- On a short-lived branch merged through a pull request
- Directly on main with frequent force pushes
- On a long-lived develop branch merged once per quarter
- On a separate fork owned by the release manager
A GitHub commit should link to Azure Boards work item 412. What do you put in the commit message?
- AB#412
- WI-412
- #412 only
- boards:412
Which phrase in a GitHub pull request description closes issue 57 when the PR is merged into the default branch?
- Fixes #57
- Links #57
- See #57
- Ref #57
In Azure Boards, what does cycle time measure?
- Time from when work starts to when it's done
- Time from when an item is created to when it's done
- Time a build spends waiting in the queue
- Time between two production deployments
Which of these is one of the four DORA metrics?
- Change failure rate
- Lines of code per developer
- Number of open pull requests
- Story points per sprint
What does the DORA metric 'time to restore service' measure?
- How long it takes to recover from a production failure
- How long a code review takes on average
- How long a build agent takes to start
- How long it takes to onboard a new developer onto the production team
A team using the Scrum process in Azure Boards wants to add a new requirement. Which work item type do they create?
- Product Backlog Item
- User Story
- Requirement
- Issue
A team wants a list of all active bugs assigned to them, refreshed automatically on a dashboard. What should they create?
- A shared work item query shown in a query tile
- A wiki page that someone updates by hand at the start of each morning
- A release pipeline that emails a CSV
- A branch policy on the main branch
Documentation should be versioned with the code and changed through pull requests. Which Azure DevOps wiki option fits?
- Publish a code repository folder as a wiki
- Use the default project wiki only
- Store each page as an attachment on an Azure Boards work item
- Upload PDF files to Azure Artifacts
Which syntax lets you draw flowcharts and sequence diagrams as text in Azure DevOps wikis and GitHub Markdown?
- Mermaid
- YAML anchors
- Bicep
- KQL
Release notes should be generated automatically for each release. What is the most common source?
- Commit messages and PR titles since the last release tag
- Comments in the team's chat channel
- The pipeline's agent capabilities
- The Azure Advisor recommendations list
Which format is commonly used to generate interactive REST API documentation from code?
- OpenAPI (Swagger)
- Mermaid
- SemVer
- Bicep
An external system must be notified whenever a build completes in Azure DevOps. What should you configure?
- A service hook (webhook)
- A branch policy
- A variable group
- A deployment slot that swaps when the build is done
How do you link Azure Boards to GitHub repositories so commits and PRs can update work items?
- Install the Azure Boards app and connect the repos
- Add a CODEOWNERS file to each repo
- Create a variable group for each repo
- Enable Git LFS on the GitHub organization and every repository
A team wants pipeline and PR notifications posted into a Microsoft Teams channel. What should they use?
- The Azure Pipelines or GitHub app for Teams with subscriptions
- A Bicep template deployed to Teams
- A self-hosted agent installed in Teams
- A Git tag on each release commit
What gives end-to-end traceability from a requirement to the release that shipped it?
- Linking work items to commits, PRs, and builds
- Using one branch for all teams
- Deleting merged branches right away so history stays short and readable
- Turning off CI triggers on main
GitHub Projects should show a burn-up of completed issues over time. What should you configure?
- An insights chart in the project
- A Dependabot configuration file in the repo
- A branch protection rule
- A repository webhook
What does the DORA metric 'deployment frequency' track?
- How often code is deployed to production
- How often developers commit locally
- How often the team holds retrospectives and planning sessions
- How often pipelines are edited
A developer wants an email only when a build they queued fails. Where do they set this up in Azure DevOps?
- Personal notification settings
- Branch policies on the main branch
- Agent pool settings
- Project wiki settings
In Azure Boards, lead time is always shorter than or equal to cycle time for the same work item.
Which branching strategy has developers merge small, short-lived branches into main at least daily?
- Trunk-based development
- GitFlow with long-lived develop branches
- Release-only branching
- Fork-and-forget branching
Why would a team create a release branch?
- To stabilize a release while main keeps moving
- To store large binary files outside Git
- To give outside contributors write access without touching the main branch
- To run pipelines without any triggers
In Azure Repos, pull requests into main must pass a build before they can complete. Which branch policy do you add?
- Build validation
- Comment resolution
- Limit merge types
- Automatically included reviewers
In GitHub, merges to main must require passing CI checks and one approval. What do you configure?
- A branch protection rule or ruleset
- A CODEOWNERS file alone, with no other settings
- A GitHub Actions secret
- A repository webhook
Every PR into main should become a single commit on main. Which merge setting do you enforce?
- Squash merge only
- Basic merge (no fast-forward) only
- Rebase and fast-forward only
- Semi-linear merge only
Changes to the /infra folder must automatically request a review from the platform team in GitHub. What should you add?
- A CODEOWNERS file
- A .gitignore file
- A Git LFS pointer
- A Dependabot file
A repository stores large design files and videos that bloat clones. What should you use?
- Git Large File Storage (LFS)
- Git tags
- Squash merges
- Shallow branch policies
A huge monorepo is slow for everyday Git commands. Which Microsoft-built tool improves Git performance for large repos?
- Scalar
- Git LFS
- CODEOWNERS
- Dependabot
What is the difference between an annotated tag and a lightweight tag?
- Annotated tags store the tagger, date, and message
- Lightweight tags can't be pushed to a remote such as GitHub or Azure Repos
- Annotated tags can only be made by admins
- Lightweight tags are stored in Git LFS
A developer deleted a local branch with unmerged commits. Which command helps find those commits?
- git reflog
- git blame
- git status
- git tag
A bad commit is already pushed to a shared main branch. What is the safest way to undo it?
- git revert
- git reset --hard and force push
- Delete the main branch and recreate it
- git commit --amend and force push
A password was committed and pushed months ago. What must you do in addition to removing it from history?
- Rotate the password, because it's already exposed
- Nothing else; removing it from history fully protects the account
- Mark the repository as private only
- Add the file to .gitignore only
A hotfix commit on main must also go onto the release/2.1 branch without merging everything else. Which command fits?
- git cherry-pick
- git merge --squash main
- git rebase main
- git stash pop
Which Azure Repos permission controls whether a user can rewrite history on a branch?
- Force push (rewrite history and delete branches)
- Contribute to pull requests
- Read
- Create tag
Open-source contributors without write access should be able to propose changes. Which workflow fits?
- Forks and pull requests
- Shared credentials to the main repo
- Direct pushes to the release branch
- Emailing patches to an admin
A developer wants feedback on unfinished work without anyone merging it yet. What should they open?
- A draft pull request
- A release branch
- An annotated tag
- A Dependabot alert
Several repos need to share a common library. Which approach avoids copying the code into each repo?
- Publish it as a versioned package
- Copy the files into every repo
- Keep it in a developer's local folder
- Put it in each repo's wiki
In Azure Repos, a policy should block PR completion until every reviewer comment is addressed. Which policy fits?
- Check for comment resolution
- Limit merge types
- Build validation
- Automatically included reviewers
A developer needs to switch branches but has uncommitted changes they aren't ready to commit. Which command fits?
- git stash
- git revert
- git tag
- git reflog expire
git revert rewrites the existing commit history of the branch.
An Azure Artifacts feed should cache packages from nuget.org so builds keep working if the public registry is down. What do you configure?
- An upstream source
- A feed view called @release
- A retention policy
- A service hook
Packages should be published to a feed but promoted to consumers only after testing. Which Azure Artifacts feature fits?
- Feed views such as @prerelease and @release
- Separate Azure DevOps organizations for every package version
- Git tags on the feed
- Branch policies on the feed
Code lives in GitHub, and packages should sit next to the repo with GitHub permissions. Which service fits best?
- GitHub Packages
- Azure Container Instances
- Azure Boards
- Azure Load Testing
Under semantic versioning, a library at 2.4.1 adds a breaking API change. What is the next version?
- 3.0.0
- 2.5.0
- 2.4.2
- 2.5.1
Under semantic versioning, a library at 2.4.1 gets a backward-compatible bug fix. What is the next version?
- 2.4.2
- 2.5.0
- 3.0.0
- 2.4.1.1
Which version string marks a SemVer prerelease?
- 1.3.0-beta.2
- 1.3.0.2
- v1.3
- 1.3.0+20261101
A team versions releases like 2026.11.1. What is this scheme called?
- Calendar versioning (CalVer)
- Semantic versioning (SemVer)
- Build metadata versioning
- Git LFS versioning
A feed is filling with thousands of old prerelease package versions. What should you configure?
- Feed retention policies
- A larger upstream source
- More parallel jobs
- A new feed view
A deployment to production must wait until Azure Monitor shows no active alerts for the staging environment. What do you add?
- A check or gate that queries Azure Monitor alerts
- A larger build agent
- A Git LFS rule
- A squash merge policy on the main branch of the repository
A release should be blocked if code coverage drops below 80%. What should you implement?
- A quality gate on the coverage result
- A wiki page that lists coverage
- A scheduled trigger every night
- A Git tag on each commit that records the coverage value