Bite-sized, standalone interview questions and answers for CI/CD. Read 5-10 per sitting. Each answer is 2-4 sentences max and stands on its own.

73 questions shown. Filter by keyword or difficulty below.

Topic: CI fundamentals (from manual builds to automated pipelines) (Order 1)

Local builds prove “it works on my machine” — same SDK version, same cached deps, same stale branch. CI provisions a fresh ephemeral runner from a known-clean state every time, so “it passed CI” means something reproducible that a local build never can. The environment is identical for every contributor, every commit.

The pull_request trigger is the pre-merge gate — it validates the branch before it’s allowed to merge. The push: branches: [main] trigger re-validates after merge, catching the case where two individually-passing PRs merge into a broken combination. Only one trigger misses this class of integration failure.

It prevents the workflow from running at all when only matched files change. A markdown-only PR or a change scoped entirely to a separate subsystem skips the entire workflow rather than spinning up a runner to build a solution that change couldn’t possibly break — real compute cost and time savings, not just tidiness.

It reuses the binaries from the dotnet build step instead of rebuilding. The test step trusts the build step’s output rather than repeating expensive work — a small but real detail that prevents the test step from masking build failures by rebuilding silently.

Nothing. The pipeline just reports pass/fail onto the commit or PR as a status check. Without an explicit enforcement layer (branch protection rules), a red build and a green build are both mergeable by clicking the same button — the signal exists but nothing is wired to act on it.

It reads the repo’s own global.json to pick the SDK version, meaning CI is guaranteed to build with the same SDK version every contributor’s dotnet CLI resolves to locally — not whatever happens to be newest on the runner image. This pins the toolchain to what the repo declares, not what the CI environment defaults to.

Topic: GitHub Actions workflow anatomy (Order 2)

Jobs run on separate runners with no shared filesystem — a step’s output is a value on that runner’s local state, not in a global namespace. The job must explicitly re-expose it in its outputs: block to make it accessible across the runner-isolation boundary. A value computed in a step but never declared at the job level is genuinely invisible to other jobs.

It creates a data-access relationship (needs.<job>.outputs) and an execution-order dependency (the consuming job waits for the producing job to finish). You cannot reference another job’s outputs without also making your job depend on its completion — the two are inseparable.

Passing structured or multi-line values as an environment variable avoids string-interpolation escaping concerns in downstream scripts. The value arrives as a genuine environment variable the script can read normally, rather than requiring shell-safe quoting inside a run: command string.