MidCI/CD

Our pipeline takes 45 minutes and developers have stopped waiting for it. How do you fix that?

What they are really testing: Whether you measure before optimising, and whether you understand that pipeline duration is a behavioural problem: past a threshold people context-switch away and stop treating red builds as urgent.

A real interview question

Our pipeline takes 45 minutes and developers have stopped waiting for it. How do you fix that?

What most people say

drag me

Add more powerful runners so everything runs faster.

It buys a linear improvement for a cost, without asking where the time goes. If 30 of the 45 minutes are a serial dependency chain or an uncached install, faster hardware barely helps and the bill rises permanently.

The follow-ups they ask next

  • What is the risk of moving tests to post-merge?

    Main can break, so it needs fast revert culture and a merge queue for busy repos. The trade is honest: faster PR feedback, slightly higher chance of a broken main that must be fixed quickly.

  • How do you cache safely without serving stale artifacts?

    Key the cache on the lockfile hash, not the branch, so a dependency change misses the cache automatically. Never cache anything the build output depends on without including it in the key.

What the interviewer is listening for

  • Measures before optimising
  • Knows the 10 minute attention threshold
  • Treats bigger runners as a last resort

What sinks the answer

  • Throws hardware at it first
  • Caches without a sound key
  • No awareness of the merge queue trade-off

If you genuinely do not know

Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.

First [measure per stage, since the bottleneck is rarely where you think]. Then [cache dependencies keyed on the lockfile], [parallelise independent stages], and [shard tests]. Split so [PRs get fast gates and slow suites run post-merge]. Bigger runners are [the last lever, not the first].

Keep going with ci/cd

All 87 devops engineer questions

Knowing the answer is not the same as recalling it under pressure

Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.

Start free