InterviewBuddy
All interview questions

When should a pipeline use a cache versus an artifact?

Intermediate

Answer

Caches speed up repeat work such as dependency installation. Artifacts preserve outputs such as packages, reports, or deployable bundles.

Explanation

A cache miss should not change correctness; deployables need explicit identity and retention.

Example

Cache downloaded dependencies; upload the built application as an artifact.