hardDesignScenarioSeniorStaff
Your monorepo's CI runs the full test suite on every pull request, and it now takes forty minutes regardless of whether someone touched one file or a hundred. How would you fix that?
4 min readUpdated 2026-08-15
Answer
Short answer
Build a dependency graph of the repository's build targets, diff the changed files against it to compute the affected subset, and run only that subset; the graph's correctness, not the diff itself, is what determines whether the speedup is trustworthy.
Was this answer helpful?
Likely follow-ups
- How would you handle a change to a shared configuration file or a build tool version, which nothing depends on explicitly but which can break everything?
- What would make you distrust the affected-target result for a given PR and fall back to running everything?
- How would you test the graph itself for correctness, separately from testing the code it describes?
- How does this interact with a merge queue, where several PRs land close together and each recomputes an affected set against a slightly different base?
Related questions
- A popular key expires and forty thousand requests reach the database in the same second. What do you change?hardAlso on caching5 min
- A user's access to a document set is revoked. What has to happen across your RAG stack?hardAlso on caching6 min
- A document was updated an hour ago and the assistant is still quoting the old version. Walk me through the diagnosis.hardAlso on caching6 min
- How do you execute a global CDN cache invalidation for a critical security patch without melting your origin servers under a thundering herd?hardAlso on caching3 min