The CI pipeline takes 45 minutes. Developers want it under 10. How do you approach it?

IntermediateScenarioPipelines at scale
Answer

Situation read → Don't optimise blindly. Measure where the time goes, then remove waiting, repetition and serial work.

What I'd do →

  1. Get timings per job and step for the last 50 runs; find the critical path.
  2. Cache dependencies and Docker layers (BuildKit cache to the registry or GitHub cache).
docker buildx build --cache-from type=registry,ref=ecr/app:cache \
  --cache-to type=registry,ref=ecr/app:cache,mode=max -t ecr/app:$SHA --push .
  1. Parallelise: run lint, unit tests and the image build at the same time; shard tests across runners.
  2. Skip what's not affected: path filters, or build only changed services in a monorepo.
  3. Move slow end-to-end suites to after merge or to a nightly run, keeping a fast smoke test on PRs.
  4. Fix the slowest tests and remove sleeps; one 4-minute integration test is often half the problem.

Why → Time on the critical path is what developers feel; speeding up jobs off that path changes nothing.

Interview tip → Say "measure the critical path first"; it shows method rather than random tweaks.

All Real-World Interview questions Roadmap: Interview readiness

More on Pipelines at scale