With 150 PRs a day, main keeps breaking because PRs that pass alone fail together. How do you fix it?

IntermediateScenarioPipelines at scale
Answer

Situation read → Each PR was tested against an old version of main. Two green PRs can conflict logically. A merge queue tests them in the order they'll land.

What I'd do →

  1. Enable GitHub merge queue (or GitLab merge trains) on main.
  2. Make CI run on the merge_group event too:
on:
  pull_request:
  merge_group:
  1. The queue builds main + PR1, main + PR1 + PR2, and so on; a failing entry is removed and the rest re-tested.
  2. Keep the queued check fast (unit and key integration tests) so throughput stays high; run long suites post-merge.
  3. Turn off "require branches to be up to date" once the queue is on; the queue does that job.

Why → Testing the exact combination that will land is the only way to keep main green at high volume.

Interview tip → Mention the merge_group trigger; missing it is the usual reason the queue gets stuck.

All Real-World Interview questions Roadmap: Interview readiness

More on Pipelines at scale