Founding prices until 15 December: 30% off Pro, locked for life. See pricing

CI/CD interview questions

3 questions. Pipeline stages, secrets in pipelines and flaky tests. Each has a strong answer of about a minute and the points an interviewer listens for.

  1. 01

    Walk me through the stages of a CI/CD pipeline you'd set up for a web service.

    A strong answer

    On every push, CI builds the code and runs the unit tests and a linter, plus a security scan of the dependencies and the image. If that passes on the main branch, it builds a Docker image once, tags it with the commit, and pushes it to the registry. CD deploys that same image to staging, runs a few smoke tests, and then promotes the same image to production, after an approval or automatically. If production looks bad, rolling back is just deploying the previous tag.

    What the interviewer listens for

    • Build and test on every change. The core of CI. Every push is built and tested.
    • Check quality and security. Linting and scanning catch problems before they ship.
    • Build an artifact once and promote it. The image tested is the image deployed. Building again per environment is a classic mistake.
    • Deploy to staging, then production. Shows the path to production.
    • Roll back easily. Deploys go wrong. A fast way back is part of the design.

    Likely follow-up: “How would you keep secrets like database passwords out of the pipeline logs?”

    Practise answering it
  2. 02

    How do you handle secrets, like a cloud access key, in a CI/CD pipeline?

    A strong answer

    Secrets never go into the repository or the image. The pipeline reads them at run time from the CI system's encrypted secret store or a vault, and they're masked in the logs. Better still, I'd avoid long-lived keys entirely: with OIDC the pipeline gets short-lived cloud credentials by assuming a role. Whatever the pipeline gets should have least privilege, only what that deploy needs, and any static secret should be rotated regularly.

    What the interviewer listens for

    • Never commit them to the repository. The first rule, said plainly.
    • Use the CI's secret store or a vault. The pipeline reads secrets at run time from a protected store.
    • Prefer short-lived credentials. OIDC or assumed roles mean there's no long-lived key to leak. A strong answer mentions it.
    • Least privilege and rotation. Limit what a leaked secret can do, and change it regularly.

    Likely follow-up: “A key was committed to Git by accident. What do you do?”

    Practise answering it
  3. 03

    A test fails randomly, about one run in five, and people just re-run the pipeline until it passes. What would you do?

    A strong answer

    Re-running until it's green is the real problem: people learn to ignore red builds and real failures slip through. I'd quarantine the test, so it still runs but doesn't block merges, and open a ticket with an owner. Then find the cause, usually timing (a sleep instead of waiting for a condition), tests sharing state or depending on order, or calls to a real network service. I'd try to reproduce it by running it many times in a loop, fix it, and move it back.

    What the interviewer listens for

    • Treat it as a real problem. Re-running until green teaches people to ignore red builds. Saying so shows maturity.
    • Quarantine it so it stops blocking. Quarantining keeps the team moving while it's fixed.
    • Find the cause. Flaky tests usually come from timing, shared state or external calls.
    • Give it an owner. A quarantined test without an owner stays quarantined forever.

    Likely follow-up: “How would you find out which tests in the suite are flaky?”

    Practise answering it

Ready for the real thing?

A timed interview asks questions like these one at a time, adds quick questions, a design and a hands-on task on a real machine, and ends with a hire or no-hire scorecard.

Take a practice interview