Skip to main content

How do you structure a CI pipeline for a monorepo with multiple services?

  • monorepo
  • pipeline structure
  • optimization

Answer it first, then compare. Nothing here is saved or scored.

Model answer

Key principles: (1) Only build and test what changed, use file path filters or tools like Nx/Turborepo to detect affected projects. (2) Shared CI steps for common operations (linting, type checking). (3) Parallel jobs per service for independent build/test. (4) Dependency-aware ordering: if service A depends on library B, test B first. (5) Caching: node_modules, build artifacts, Docker layers. (6) Selective deployment: only deploy changed services. Tools: GitHub Actions path filters, Nx affected commands, Bazel for large monorepos.

What interviewers listen for

  • Pipeline shape
    You design stages by failure cost and runtime budget, not by tool feature lists.
  • Parallelisation craft
    You can shard a real suite and explain the state-isolation choices you made.
  • Quality gates
    You know which checks block merge, which warn, and why those defaults are correct.
  • Shift-left fluency
    You talk about ownership transfer, not just earlier execution.

See all 34 ci/cd questions

Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026