Explain CI/CD architecture, build-once artifacts, and deployment gates
Quick Summary: CI (Continuous Integration) automatically builds, lints, security-scans, and tests every commit into one immutable artifact, while CD (Continuous Delivery/Deployment) promotes that exact verified artifact across staging and production via automated health checks.
Direct Interview Answer
Continuous Integration catches integration regressions early via fast automated tests and static analysis on every pull request.
Continuous Delivery produces a signed immutable build artifact (Docker image pinned by SHA digest) promoted unchanged across staging and production—never recompiled per environment—stopping unsafe manual server edits.
Detailed Technical Explanation
Key production gates include dependency/container vulnerability scans (Trivy/SAST), automated database migration checks (expand-and-contract backward compatibility), readiness probes, and automated rollback triggers if error rate budgets breach post-release.
Practical Walkthrough
Minimal GitHub Actions workflow enforcing test + immutable image tag build.
name: ci-release
on: [push]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: vendor/bin/phpunit --compact
- run: npm run build
Every push runs automated tests and asset compilation before deployment promotion.
Real-World Production Use Case
Enforcing zero-downtime releases across SaaS teams where dozens of pull requests ship daily with full auditability.
Common Interview Mistakes to Avoid
- Rebuilding application source separately for staging and production instead of promoting one immutable image digest.
- Running destructive non-backward-compatible DB column drops before old pods finish draining.