1. Which metric directly measures the time from commit to a production deployment?
Lead time tells you how quickly code flows from commit to release. It is a key delivery speed signal used widely in DevOps reporting.
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Microsoft · CI/CD Pipelines
Practice CI/CD Pipelines questions specifically asked in Microsoft interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
14
Tagged for this company + subject
Company
Microsoft
View company-wise questions
Subject
CI/CD Pipelines
Explore topic-wise practice
Go through each question and its explanation. Use this page for targeted revision just before your Microsoft CI/CD Pipelines round.
Lead time tells you how quickly code flows from commit to release. It is a key delivery speed signal used widely in DevOps reporting.
For complete preparation, combine this company + subject page with full company-wise practice and subject-wise practice. You can also explore other companies and topics from the links below.
The pipeline watches the repo for changes, so version control becomes the single source of truth. It gives history, reviews, and easy rollback, and it triggers automation the moment code changes.
Keep deployments versioned and immutable. If health checks fail or error rate spikes, promote the last good artifact back to production. For blue green or canary, flip traffic to the stable version while you investigate and fix forward in a new release.
Use a cache to reuse things like npm or Maven downloads and avoid repeated network work. Use artifacts to pass built outputs between stages. This split keeps runs fast and results reproducible.
cache: paths: - ~/.m2/repository - node_modules
Extract shared steps into templates or a shared library. Parameterize things like image name, test command, and deploy target. Each repo imports the template and overrides only what is unique. One change improves all pipelines.
uses: org/reusable-workflows/.github/workflows/build-test.yml@v1 with: service_name: payments
Protect the branch with required checks and approvals. If any check fails, the merge is blocked. This policy keeps main deployable at all times.
Require: build, unit, lint, security to pass before merge
Think of it like infrastructure as code, but for delivery. You commit the pipeline file, review it, and track its history. This gives repeatability, easy rollbacks, and the same process across branches and teams.
Jenkinsfile or .github/workflows/ci.yml stored at repo root
Conditions like when, rules, or if statements let you run jobs only for release events. That keeps regular pushes fast and safe.
if: startsWith(github.ref, 'refs/tags/') steps: - run: ./publish.sh
First create the artifact in the build step. Then validate it with tests. If all green, deploy to an environment. This flow reduces risk by catching issues before they reach users.
If lint, unit tests, or security checks fail, the pipeline should halt. Fast failure gives quick signal and avoids wasting compute on later stages.
Make deploy idempotent and atomic. Use versioned, immutable artifacts. If a step fails, you can retry without double-deploying. Add clear prechecks and postchecks, and keep a quick rollback path to the last good version.
deploy.sh --version=$ARTIFACT_VERSION healthcheck /ready if fail -> rollback to PREV_VERSION
The moment code is pushed or a pull request opens, the V C S calls the CI server. This gives fast feedback so developers fix issues while the context is fresh.
Guard deploy steps with rules. Build and test can run everywhere, but deployment should gate on main or release branches. This prevents accidental production pushes.
if: github.ref == 'refs/heads/main' steps: - run: ./deploy.sh
Multi-stage builds keep images small and secure. Caching dependency layers speeds up rebuilds. Never bake secrets into images; inject them at runtime.
FROM node:20 as deps WORKDIR /app COPY package*.json . RUN npm ci COPY . . RUN npm run build FROM node:20-alpine COPY --from=deps /app/dist ./dist