AZ-400 Practice Question: Design and implement a source control strategy
Your organization uses GitHub and wants to implement a monorepo strategy for multiple related projects. Which approach best optimizes CI/CD pipeline performance by only building projects that have changed?
⚠ Common exam trap
Many candidates confuse workflow reuse mechanisms (templates, composite actions) with conditional execution, or assume submodules are the standard monorepo approach, when in fact path filters are the native and efficient way to achieve selective builds in GitHub Actions.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use path filters in GitHub Actions workflows
GitHub Actions path filters (using `on.push.paths` or `on.pull_request.paths`) allow you to trigger workflows only when changes are made to specific directories or files. In a monorepo, this ensures that CI/CD pipelines run exclusively for the projects that have been modified, avoiding unnecessary builds and significantly improving performance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a single workflow that builds all projects on every push
Why it's wrong here
A single workflow that builds all projects on every push is inefficient for a monorepo because it triggers the entire build and test suite for every commit, even when changes are isolated to one component. This wastes compute time, slows down CI feedback, and creates unnecessary coupling between unrelated projects.
- ✗
Use submodules to separate projects
Why it's wrong here
Using submodules to separate projects breaks the monorepo model by introducing nested Git repositories, requiring manual synchronization and version coordination. It adds complexity, risks broken references, and does not leverage GitHub Actions' native monorepo capabilities, making it a poor choice for monorepo optimization.
- ✗
Use workflow templates and composite actions
Why it's wrong here
Workflow templates and composite actions improve reusability and maintainability, but they do not optimize when workflows run or limit execution to changed projects. They are a code-organization technique rather than a scoping solution, so on their own they still execute on every push unless combined with path filters.
- ✓
Use path filters in GitHub Actions workflows
Why this is correct
Path filters in GitHub Actions, using `on.push.paths` or `pull_request.paths`, allow workflows to trigger only when specific files or directories change, so only the affected projects are built and tested. This is a best practice for monorepos because it reduces CI resource usage and provides faster, targeted feedback.
Go deeper
Related to this question
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.