Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

CI/CD Interview Questions and Answers

By Kokil Thapa | Last reviewed: September 2026

Strong CI/CD interview questions and answers separate candidates who have run real pipelines from those who only know buzzwords. Interviewers probe whether you can explain continuous integration, continuous delivery, and deployment safety under pressure. They also test whether you have shipped code through automated gates on a production Laravel or PHP stack. This guide covers the questions I hear most often in 2026, with answers grounded in production work — including GitLab CI pipelines for Laravel and zero-downtime VPS deploys.

What is CI/CD and why do interviewers ask about it?

Interviewers ask about CI/CD because it reveals how you work in a team. Manual deploys break. Untested merges reach production. Pipelines catch those problems early.

Sample question: "Explain CI/CD in your own words."

Strong answer: Continuous Integration means every merge triggers automated build and test steps. Developers integrate code frequently. Broken builds get fixed before they pile up. Continuous Delivery means every passing build is deployable. A human or policy may still approve the final push. Continuous Deployment goes further — passing builds go live automatically.

On production Laravel apps I maintain, CI runs on every push to the main branch. It installs Composer dependencies, runs Pest tests, and lints PHP. CD only runs after merge to a release branch or tag. That split keeps feature branches fast while protecting production.

CI/CD Pipeline OverviewCommitGit pushBuildComposer npmTestUnit featureDeployStaging prodQuality Gates Block Bad ReleasesFailed tests, lint errors, coverage dropsSecrets scan, migration dry-run
CI/CD interview questions often start with pipeline stages: commit, build, test, deploy, and the gates between them.

Follow-up question: "What problem does CI solve that manual testing does not?"

Answer: CI gives fast, repeatable feedback on every change. Manual testing happens late and skips edge cases. A pipeline runs the same steps every time. It catches dependency conflicts, broken migrations, and failing tests within minutes.

How do you explain a CI/CD pipeline in an interview?

Interviewers want a concrete walkthrough, not a textbook definition. Describe triggers, jobs, artifacts, and environments.

Sample question: "Walk me through a pipeline you have built."

Strong answer structure:

  1. Trigger: Push to main, merge request, or tag.
  2. Install: PHP 8.3+, Composer 2.10, Node.js 26 LTS for asset builds.
  3. Test: Pest or PHPUnit, static analysis, optional coverage gate.
  4. Build artifact: Compiled Vite 8.x assets, cached vendor directory.
  5. Deploy: SSH to Ubuntu server, Deployer 7 symlink swap, PHP-FPM reload.
  6. Verify: Health check URL, smoke test, rollback on failure.

Reference a real pattern. On sister legal-tech sites I deploy with Deployer 7 and GitLab CI. The pipeline lint-checks PHP, runs tests, builds front-end assets in CI, then deploys to shared EC2 infrastructure. Shared .env and storage/ persist across releases.

Example .gitlab-ci.yml snippet interviewers appreciate:

stages:
  - test
  - build
  - deploy

variables:
  COMPOSER_CACHE_DIR: .composer-cache

test:php:
  stage: test
  image: php:8.3-cli
  script:
    - composer install --no-interaction --prefer-dist
    - cp .env.testing .env
    - php artisan test --parallel
  cache:
    key: composer-$CI_COMMIT_REF_SLUG
    paths:
      - .composer-cache/
      - vendor/

build:assets:
  stage: build
  image: node:26
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - public/build/
    expire_in: 1 day

deploy:production:
  stage: deploy
  script:
    - dep deploy production --branch=$CI_COMMIT_SHA
  environment:
    name: production
  when: manual
  only:
    - main

Mention why each piece exists. Cache speeds Composer installs — see CI/CD caching for Composer and npm. Manual deploy gate on main prevents accidental production pushes. Artifacts pass built assets to deploy without rebuilding on the server.

Sample question: "What is an artifact in CI/CD?"

Answer: An artifact is a file or bundle produced by one job and consumed by a later job or deploy step. Common examples: compiled JavaScript, Docker images, ZIP packages, test reports. Artifacts should be immutable and tagged with the commit SHA.

Pipeline stages you should name clearly

  • Lint/static analysis: PHPStan, ESLint, Pint — cheap failures first.
  • Unit and feature tests: Fast tests in parallel; see Laravel testing with Pest in CI/CD.
  • Integration tests: Database, Redis, external API mocks.
  • Security scan: Dependency audit, secrets scan.
  • Deploy to staging: Run migrations against a staging DB copy.
  • Production deploy: Blue-green, rolling, or symlink release.

What CI/CD tool comparison questions appear in interviews?

Tool questions test practical trade-offs, not fanboy loyalty. Interviewers often ask you to compare GitHub Actions, GitLab CI, Jenkins, and cloud-native options.

Sample question: "Compare GitHub Actions and GitLab CI."

Both are YAML-defined pipeline engines. GitHub Actions integrates tightly with GitHub repos and Marketplace actions. GitLab CI is built into GitLab and excels at self-hosted runners and monorepo workflows. For a deeper breakdown, read GitHub Actions vs GitLab CI in 2026.

CriteriaGitHub ActionsGitLab CIJenkins
HostingGitHub-hosted or self-hosted runnersGitLab.com or self-managedSelf-hosted, full control
Config formatYAML workflows in .github/workflows/.gitlab-ci.ymlJenkinsfile (Declarative or Scripted)
Learning curveLow for GitHub teamsLow to mediumHigh — plugins and maintenance
Best fitOpen-source on GitHub, small teamsPrivate repos, integrated DevOpsLegacy enterprises, custom plugins
SecretsRepo/org secrets, OIDC to cloudMasked variables, file-type secretsCredentials plugin, vault integration
Cost at scaleFree tier limits; minutes billingRunner minutes on GitLab.comServer cost only; ops overhead

Sample question: "When would you choose Jenkins over a modern SaaS CI tool?"

Answer: Choose Jenkins when you need heavy customisation, air-gapped environments, or existing Jenkins plugin investments. Avoid it for greenfield projects unless ops staff already maintain it. Maintenance cost is real — plugin updates, agent pools, backup.

CI/CD Tool Selection MatrixGitHub ActionsSmall teamsOSS on GitHubGitLab CIPrivate reposSelf-hosted runnersJenkinsCustom pluginsAir-gapped opsInterview Tip: Pick One Tool DeeplyExplain triggers, caching, secrets, and a real deployCite official docs: GitHub Actions and GitLab CI
CI/CD interview questions on tool choice reward practical trade-offs between GitHub Actions, GitLab CI, and Jenkins.

Cite official docs when asked about syntax. GitHub Actions documentation and GitLab CI/CD documentation are the authoritative references interviewers expect you to know exist.

Sample question: "What is a self-hosted runner and when do you use one?"

Answer: A self-hosted runner is a machine you control that executes pipeline jobs. Use it when you need access to private networks, larger build machines, or compliance rules that forbid shared SaaS runners. Trade-off: you patch, secure, and monitor the runner yourself. Read self-hosted CI runners setup and security before claiming production experience.

How do you answer CI/CD deployment and rollback scenario questions?

Scenario questions are where vague answers fail. Interviewers describe a failed deploy, a bad migration, or a traffic spike. You explain detection, rollback, and prevention.

Sample question: "Your deploy succeeded but users report 500 errors. What do you do?"

Strong answer:

  1. Check application logs and error tracking first — not the pipeline green checkmark.
  2. Confirm which release is live via symlink, container tag, or load balancer target.
  3. Roll back to the previous release: dep rollback production for Deployer, or swap traffic in a blue-green setup.
  4. Reload PHP-FPM to clear opcache if old bytecode is cached.
  5. Post-mortem: add a smoke test or health check gate before marking deploy complete.

On Deployer-based Laravel sites, each release lives in its own timestamped folder. The current symlink points to the active release. Rollback rewinds the symlink in seconds. That pattern ships on projects like Adventure Third Pole Trek, where booking uptime matters.

Sample question: "Explain blue-green deployment."

Answer: Blue-green keeps two identical environments. Blue serves live traffic. Green receives the new release. After health checks pass, the load balancer switches traffic to green. If green fails, switch back to blue. No downtime, fast rollback. See blue-green deployment explained for nginx and load balancer patterns.

Blue-Green Deploy FlowBlue (Live)v1.2.0 trafficGreen (Idle)v1.3.0 readyLoad BalancerHealth check gateSwitch traffic after smoke tests passRollback: point LB back to BlueUnder 60 seconds if health checks fail
Deployment scenario questions in CI/CD interviews often cover blue-green switches and fast rollback paths.

Sample question: "How do you run database migrations in CI/CD safely?"

Answer: Never run destructive migrations without a backup. Test migrations against a staging database that mirrors production schema. Use backward-compatible migrations when possible — add column first, backfill, then remove old column in a later release. Expand-contract pattern prevents downtime. Read database migrations in CI/CD pipelines for the full workflow.

Sample question: "What is the difference between rolling deployment and recreate deployment?"

Answer: Recreate stops all old instances, then starts new ones — simple but causes downtime. Rolling replaces instances gradually — better uptime but mixed versions run briefly. Blue-green and canary go further by controlling traffic shift percentage.

What CI/CD security and secrets questions should you prepare for?

Security questions have become standard. A candidate who stores API keys in Git is an immediate no-hire.

Sample question: "How do you manage secrets in a CI/CD pipeline?"

Strong answer:

  • Store secrets in the CI platform vault — GitLab masked variables, GitHub encrypted secrets.
  • Never commit .env files. Use .env.example with placeholder keys.
  • Inject secrets at runtime, not bake them into Docker images or artifacts.
  • Rotate keys after team member offboarding.
  • Scan repos for leaked credentials in CI with tools like gitleaks.
  • Use short-lived OIDC tokens for cloud deploy instead of long-lived AWS keys.

Full guidance lives in handle secrets in CI/CD pipelines safely and DevSecOps: shift security left.

Sample question: "What is shift-left security?"

Answer: Shift-left means running security checks early in the pipeline — dependency scanning, SAST, secrets detection — instead of only before production. Cheaper fixes, faster feedback. A failing secrets scan should block the merge request.

Sample question: "How do you secure the deploy SSH key?"

Answer: Store the private key as a CI secret variable. Limit the key to deploy-user on one host. Disable password auth on the server. Use authorized_keys with command restriction if possible. Audit deploy logs. For server hardening context, see Linux system administration practices.

CI/CD Security LayersSecrets Scangitleaks in CIDep Auditcomposer auditSAST LintPHPStan ESLintRuntime Secret InjectionCI vault vars, never in Git or artifactsOIDC for cloud, SSH key for VPS deploy
Security-focused CI/CD interview questions cover secrets scanning, dependency audits, and safe runtime injection.

What advanced CI/CD interview questions separate senior candidates?

Senior roles add questions about parallelism, idempotency, observability, and cost.

Sample question: "How do you speed up a slow CI pipeline?"

Answer: Profile which job consumes the most time. Cache Composer, npm, and Docker layers keyed by lockfile hash. Run tests in parallel with Pest parallel or ParaTest. Split jobs so lint runs on every push but full integration tests run on merge requests only. Use smaller Docker images. Avoid redundant work — build assets once, pass as artifact.

Sample question: "What makes a deploy idempotent?"

Answer: Running the same deploy twice produces the same result without side effects. Deploy scripts should tolerate re-runs. Use migration checks, atomic symlink swaps, and health checks. Ansible and Deployer both aim for idempotent operations.

Sample question: "How do you handle CI for a monorepo with multiple PHP apps?"

Answer: Use path-based rules so only changed apps build and test. GitLab rules:changes or GitHub path filters trigger selective pipelines. Shared packages get tested when any dependent app changes.

Sample question: "Explain canary deployment."

Answer: Route a small percentage of traffic — say 5% — to the new version. Monitor error rate and latency. Increase traffic gradually if metrics stay healthy. Roll back if alerts fire. More precise than blue-green for large user bases.

Sample question: "What metrics do you track for CI/CD health?"

Answer: Track pipeline duration, queue time, pass rate, mean time to recovery after failed deploy, deploy frequency, and change failure rate. These map to DORA metrics interviewers know from the DORA research program.

Cross-study related interview guides: Docker interview questions, DevOps engineer interview questions, and behavioral interview prep for developers. Validate JSON pipeline configs with the JSON formatter before committing workflow files.

For Laravel-specific pipeline setup, follow deploy a Laravel app with GitLab CI to a VPS and CI/CD best practices for small teams. Small Nepal agencies often run on tight budgets — Rs 15,000–40,000/month hosting (~USD 110–295) — so efficient pipelines matter.

Key Takeaways

  • Define CI, CD, and continuous deployment separately — interviewers catch blended definitions quickly.
  • Walk through a real pipeline: trigger, install, test, artifact, deploy, verify, rollback.
  • Compare tools by team size, hosting, secrets model, and ops overhead — not hype.
  • Know blue-green, rolling, and canary deploys plus when symlink rollback beats container rollback.
  • Never store secrets in Git; scan repos in CI and inject credentials at runtime only.
  • Practice scenario answers: failed deploy, bad migration, slow pipeline, runner security.

People Also Ask

What is the difference between CI and CD in simple terms?

CI automatically builds and tests every code change. CD automatically prepares or releases that tested code to staging or production. CI answers "does it work?" CD answers "can we ship it safely?" Many teams have CI fully automated but keep production deploys manual.

Which CI/CD tool is best for Laravel projects in 2026?

GitLab CI and GitHub Actions both work well with Laravel 12 or 13.x and PHP 8.3+. GitLab fits private repos and integrated issue tracking. GitHub Actions fits open-source and GitHub-centric teams. Either handles Composer 2.10, Pest tests, and Vite 8.x asset builds. Pick the platform your repo already lives on.

How do I prepare for a CI/CD interview with no DevOps title?

Document one pipeline you touched — even a simple test-on-push workflow. Explain what broke and how you fixed it. Read your project's YAML config. Run the pipeline locally where possible. Pair your CI/CD prep with backend interview prep and know basic Linux commands for deploy troubleshooting.

What CI/CD mistakes do interviewers flag as red flags?

Top red flags: secrets in Git, no tests in pipeline, deploying directly from a laptop, no rollback plan, and treating green pipeline status as proof the app works in production. Strong candidates mention health checks, smoke tests, and post-deploy monitoring.

Prepare your CI/CD interview answers with production context

The best CI/CD interview questions and answers combine theory with one pipeline you can draw on a whiteboard. Know your stages, your tool, your deploy strategy, and your rollback command. If your team still deploys over FTP or skips automated tests, build a minimal pipeline first — lint, test, manual deploy — then iterate. Need help designing a production pipeline for Laravel, WordPress, or a custom app? Contact us or explore custom software development and read more on the blog. Review my background on about me for the production systems behind these answers.

Frequently Asked Questions

CI/CD interview questions test whether you have shipped code through automated pipelines, not just memorised buzzwords. Interviewers ask because manual deploys break and untested merges reach production. Strong answers separate Continuous Integration (every merge triggers automated build and test), Continuous Delivery (passing builds are deployable, with optional human approval), and Continuous Deployment (passing builds go live automatically). On production Laravel apps, CI runs on every push while CD often waits for a release branch or tag. That split keeps feature branches fast while protecting production.

CI automatically builds and tests every code change. CD automatically prepares or releases that tested code to staging or production. CI answers whether it works; CD answers whether you can ship it safely.

Interviewers want a concrete walkthrough, not textbook definitions. Describe the trigger (push to main, merge request, or tag), install steps (PHP 8.3+, Composer 2.10, Node.js 26 LTS for asset builds), test gates (Pest or PHPUnit, static analysis), build artifacts (compiled Vite 8.x assets, cached vendor), deploy (SSH to Ubuntu, Deployer 7 symlink swap, PHP-FPM reload), and verify (health check, smoke test, rollback on failure). On sister legal-tech sites I deploy with GitLab CI and Deployer 7: lint PHP, run tests, build front-end assets in CI, then deploy to shared EC2 with persistent .env and storage/.

An artifact is a file or bundle produced by one pipeline job and consumed by a later job or deploy step. Common examples include compiled JavaScript, Docker images, ZIP packages, and test reports. Artifacts should be immutable and tagged with the commit SHA.

GitLab CI and GitHub Actions both work well with Laravel 12 or 13.x and PHP 8.3+. GitLab fits private repos, self-hosted runners, and integrated DevOps workflows — the pattern I use on Deployer 7 VPS deploys for Laravel legal-tech sites. GitHub Actions suits open-source or GitHub-centric teams with low setup overhead. Jenkins remains viable for heavy customisation or air-gapped environments, but carries higher maintenance. Choose based on repo hosting, secrets model, runner requirements, and who will maintain the pipeline — not tool hype.

Both are YAML-defined pipeline engines. GitHub Actions integrates tightly with GitHub repos and Marketplace actions; secrets live in repo or org vaults with OIDC to cloud. GitLab CI is built into GitLab, excels at self-hosted runners and monorepo workflows, and uses masked variables for secrets. GitHub suits small teams on GitHub with a low learning curve. GitLab suits private repos and integrated DevOps. Cost at scale differs: GitHub bills hosted minutes; GitLab.com bills runner minutes; self-hosted shifts cost to server ops. Cite official docs when asked about syntax.

Choose Jenkins when you need heavy customisation, air-gapped environments, or existing Jenkins plugin investments that are too costly to replace. Avoid it for greenfield projects unless ops staff already maintain it. Jenkins gives full control via self-hosted agents and a Jenkinsfile, but maintenance is real: plugin updates, agent pools, backup, and credential management through the credentials plugin or vault integration. Modern SaaS tools like GitHub Actions or GitLab CI reduce ops overhead for most Laravel teams shipping through standard build-test-deploy stages.

A self-hosted runner is a machine you control that executes pipeline jobs instead of shared SaaS runners. Use it when jobs need access to private networks, larger build machines, or compliance rules that forbid shared infrastructure. GitLab CI and GitHub Actions both support self-hosted runners. Trade-off: you patch, secure, and monitor the runner yourself. Read self-hosted CI runner setup and security guidance before claiming production experience — interviewers expect you to know the operational cost, not just the configuration syntax.

Check application logs and error tracking first, not the pipeline green checkmark. Confirm which release is live via symlink, container tag, or load balancer target. Roll back to the previous release: dep rollback production for Deployer, or swap traffic in a blue-green setup. Reload PHP-FPM to clear opcache if old bytecode is cached. Post-mortem: add a smoke test or health check gate before marking deploy complete. On Deployer-based Laravel sites, each release lives in a timestamped folder; rollback rewinds the symlink in seconds — a pattern that matters on booking systems where uptime is critical.

Blue-green keeps two identical environments running. Blue serves live traffic while Green receives the new release. After health checks pass, the load balancer switches traffic to Green. If Green fails, switch back to Blue — no downtime and fast rollback. This differs from rolling deployment, which replaces instances gradually with mixed versions briefly live, and from recreate deployment, which stops all old instances first and causes downtime. Blue-green and canary deployments give finer control over traffic shift for production safety under interview scenario questions.

Never run destructive migrations without a backup. Test migrations against a staging database that mirrors production schema. Use backward-compatible migrations when possible: add a column first, backfill data, then remove the old column in a later release. The expand-contract pattern prevents downtime during deploys. Run migrations as part of a staging gate before production, and ensure rollback plans account for schema changes — symlink rollback rewinds code quickly, but reversing a bad migration may need a separate recovery step.

Store secrets in the CI platform vault — GitLab masked variables or GitHub encrypted secrets. Never commit .env files; use .env.example with placeholder keys. Inject secrets at runtime, not baked into Docker images or artifacts. Rotate keys after team member offboarding. Scan repos for leaked credentials in CI with tools like gitleaks. Use short-lived OIDC tokens for cloud deploy instead of long-lived AWS keys. For SSH deploy keys, store the private key as a CI secret, limit it to the deploy user on one host, disable password auth, and audit deploy logs.

Shift-left means running security checks early in the pipeline — dependency scanning, SAST, secrets detection — instead of only before production. Cheaper fixes and faster feedback.

Profile which job consumes the most time first. Cache Composer, npm, and Docker layers keyed by lockfile hash — the article's GitLab example caches .composer-cache/ and vendor/ to speed installs. Run tests in parallel with Pest parallel or ParaTest. Split jobs so lint runs on every push but full integration tests run on merge requests only. Use smaller Docker images. Avoid redundant work: build Vite 8.x assets once in CI and pass public/build/ as an artifact rather than rebuilding on the server. For small Nepal agencies on Rs 15,000–40,000/month hosting (~USD 110–295), efficient pipelines reduce wasted runner minutes.

Senior interviews cover idempotency, canary releases, monorepos, and observability. Idempotent deploys produce the same result when run twice — Deployer symlink swaps and migration checks support this. Canary routes a small traffic percentage to the new version, monitors error rate and latency, then increases gradually or rolls back on alerts. Monorepos use path-based rules so only changed apps build and test. Track DORA metrics: pipeline duration, queue time, pass rate, mean time to recovery, deploy frequency, and change failure rate. Know rolling versus recreate deployment and when symlink rollback beats container rollback on Laravel VPS stacks.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: