DevOps & CI/CD

DevOps & CI/CD Interview Guide

Master DevOps phases, CI vs CD, GitOps, Git branching strategies, and DevSecOps β€” with diagrams, key takeaways, and interview tips.

5Topics
~12Min Read
5Diagrams
DevOps and CI/CD Enterprise Overview Diagram
DevOps & CI/CD β€” Enterprise Overview
Beginner ~2 min

DevOps Phases

DevOps Lifecycle Phases Diagram

DevOps CI/CD phases with recommended tools:

Phase Description Tools
Author Write code VS Code
Source Check-in source code AWS CodeCommit, GitHub
Build Compile code, create artifacts AWS CodeBuild, Jenkins
Test Unit, integration, load, UI, penetration testing AWS CodeBuild, Jenkins
Deploy Deploy artifacts Jenkins, AWS CodeDeploy
Monitor Logs, metrics, and traces Amazon CloudWatch, AWS X-Ray
πŸ’‘
Key Takeaway for Interviews

DevOps is an infinite loop: Plan β†’ Build β†’ CI β†’ CD β†’ Operate β†’ Monitor β†’ Feedback β†’ Plan. Know each phase and at least one tool per phase.

Beginner ~2 min

CI vs CD vs Continuous Deployment

Continuous Integration vs Delivery vs Deployment Diagram
  • Continuous Integration (CI) β€” Author β†’ Source β†’ Build β†’ Test. Developers frequently merge code changes, which are automatically built and tested.
  • Continuous Deployment (CD) β€” Extends CI by automatically deploying every change that passes all stages to production.
  • Continuous Delivery (CD) β€” Similar to Continuous Deployment, but includes a Manual Approval step before deploying to production.
πŸ’‘
Key Takeaway for Interviews

The key difference: Continuous Delivery requires manual approval before production; Continuous Deployment deploys automatically. Both extend CI.

Intermediate ~3 min

Traditional CICD vs GitOps

Traditional vs GitOps Pipeline Diagram

Traditional DevOps (Push-based)

  1. Developers check in Code, Dockerfile, and manifest YAMLs to an application repository. CI tools (e.g. Jenkins) build the container image and save it in a container registry such as Amazon ECR.
  2. CD tools (e.g. Jenkins) update the deployment manifest files with the tag of the container image.
  3. CD tools execute the command to deploy the manifest files into the cluster, deploying the newly built container in Amazon EKS.

Conclusion: Traditional CI/CD is a push-based model. If a sneaky SRE changes the YAML file directly in the cluster, the resources running in the cluster will deviate from what's defined in Git.

GitOps (Pull-based)

  1. Developers check in Code, Dockerfile, and manifest YAMLs. CI tools build the container image and save it in Amazon ECR.
  2. CD tools update the deployment manifest files with the tag of the container image.
  3. With GitOps, Git becomes the single source of truth. You install a GitOps tool like Argo inside the cluster and point to a Git repo. It keeps checking if there is a new file, or if the files in the cluster drift from the ones in Git. As soon as YAML is updated, ArgoCD detects the drift and pulls in the updated YAML file to deploy the new container.

Conclusion: GitOps does NOT replace DevOps β€” it only replaces part of the CD process. If the sneaky SRE directly changes the YAML in the cluster, ArgoCD will detect the mismatch, pull in the file from Git, and bring Kubernetes resources to its intended state.

πŸ’‘
Key Takeaway for Interviews

GitOps = Git as single source of truth + pull-based reconciliation. It does NOT replace CI β€” only the CD part. Know ArgoCD and Flux by name.

Intermediate ~3 min

Git Workflow Strategies

Git Branching Strategies and Workflow Diagram

Git Flow

  • main β€” Production-ready code. Only receives merges from release or hotfix branches.
  • develop β€” Integration branch for features. All feature branches merge here.
  • feature/* β€” One branch per feature. Created from develop, merged back into develop.
  • release/* β€” Stabilization branch. Created from develop when ready for release, merged into both main and develop.
  • hotfix/* β€” Emergency fixes off main. Merged back into both main and develop.

Trunk-Based Development

  • All developers commit directly to main (or via very short-lived feature branches).
  • Relies on feature flags to hide incomplete features in production.
  • Preferred for CI/CD-heavy teams β€” enables continuous deployment with small, frequent releases.

GitHub Flow (Simplified)

  • Single main branch + feature branches. Pull request β†’ code review β†’ merge to main β†’ deploy.
  • Best for smaller teams and SaaS products with continuous delivery.
πŸ’‘
Key Takeaway for Interviews

Know all three strategies. Git Flow = complex releases. Trunk-Based = CI/CD + feature flags. GitHub Flow = simple PR-based. Most interviewers ask "which would you choose and why?"

Advanced ~2 min

DevSecOps Workflow

DevSecOps Security Integrated Pipeline Diagram

DevSecOps integrates security into every phase of the CI/CD pipeline rather than treating it as a final gate:

Phase Security Activity Tools
Code Static Application Security Testing (SAST), secret scanning SonarQube, git-secrets, Snyk
Build Dependency vulnerability scanning, container image scanning Trivy, ECR Scan, Snyk
Test Dynamic Application Security Testing (DAST), penetration testing OWASP ZAP, Burp Suite
Deploy Infrastructure as Code scanning, compliance checks Checkov, tfsec, AWS Config
Runtime Threat detection, anomaly monitoring, WAF GuardDuty, AWS WAF, Shield

Key Principles

  • Shift Left β€” Find and fix vulnerabilities as early as possible (in code, not in production).
  • Automate Everything β€” Security checks run automatically in the pipeline; no manual gates.
  • Shared Responsibility β€” Security is everyone's job, not just the security team's.
  • Continuous Monitoring β€” Runtime protection with GuardDuty, CloudTrail, and automated remediation.
πŸ’‘
Key Takeaway for Interviews

"Shift Left" is the buzzword interviewers love. Know SAST vs DAST, and name at least one tool per pipeline phase. DevSecOps β‰  a separate team β€” it's security baked into DevOps.

Advanced

Interview Questions β€” DevOps & CI/CD

DevOps questions test your understanding of CI/CD pipelines, deployment strategies, and operational excellence at scale.

Real-World 45-Minute DevOps Interview

Review a complete, recently recorded 45-minute DevOps interview transcript. Includes high-level Q&A on ECS, ECR, Docker sizing, RDS, GitOps, observability, and Linux fundamentals.

Read the Interview Transcript
  1. Answer Guide
    Pipeline in a shared tooling account. Cross-account IAM roles assumed by the pipeline. Artifact stored in S3/ECR with cross-account policies. Stage gates between environments. Use OIDC federation (no long-term keys) for GitHub Actions or CodePipeline cross-account.
  2. Answer Guide
    Blue/green for zero-downtime with instant rollback. Canary for gradual risk reduction (5% β†’ 25% β†’ 100%). With DB schema changes, you MUST ensure backward compatibility β€” both old and new code versions must work with the new schema. This rules out big-bang blue/green without careful planning.
  3. Answer Guide
    Automated quality gates: unit tests, integration tests, SAST/DAST, container image scanning, approval gates for prod. Canary deployments with automatic rollback on error rate thresholds. Discuss DORA metrics: deployment frequency, lead time, MTTR, change failure rate.
  4. Answer Guide
    GitOps: Git is the source of truth for desired state. ArgoCD (pull-based) watches the repo and reconciles. Push-based: pipeline pushes changes directly. GitOps NOT ideal for: database migrations, one-time scripts, secret rotation (secrets shouldn't be in Git).
  5. Answer Guide
    Feature flags (LaunchDarkly, AWS AppConfig). The incomplete feature is merged to main but hidden behind a flag. This avoids long-lived branches while keeping main deployable. Discuss: branch by abstraction pattern for larger refactors.
  6. Answer Guide
    Schema changes must be backward-compatible and decoupled from code deployments. Expand-contract pattern: 1) Add new column, 2) Deploy code that writes to both old and new, 3) Migrate data, 4) Deploy code that reads only from new, 5) Remove old column. Never deploy schema + code together.
  7. Answer Guide
    Parallelize test suites, cache dependencies (npm, Docker layers), run only affected tests (test impact analysis), split unit/integration/e2e into stages with fast-fail. Consider: monorepo tools (Turborepo, Nx) that build only changed packages. Target: under 10 minutes for the critical path.
  8. Answer Guide
    Pre-commit: secrets scanning (gitleaks). Build: SAST (Snyk, SonarQube), dependency scanning (npm audit). Container: image scanning (Trivy, ECR scanning), base image policy. Deploy: OPA/Kyverno admission policies. Runtime: GuardDuty for EKS, Falco for container anomalies.
  9. Answer Guide
    CDK β€” generates CloudFormation, uses familiar languages (Python, TypeScript), great for teams already in AWS. Terraform β€” provider-agnostic, mature state management, large community. CDK for AWS-only shops; Terraform for multi-cloud or teams needing explicit state control. Discuss state management trade-offs.
  10. Answer Guide
    DORA: Deployment Frequency, Lead Time for Changes, MTTR (Mean Time to Recover), Change Failure Rate. Priority: MTTR first β€” 24 hours is too long. Implement automated rollback, better monitoring/alerting, and runbooks. Then increase deployment frequency (smaller, safer changes).

Preparation Strategy

DevOps interviews test operational maturity. Don't just describe tools β€” explain your pipeline design principles: fast feedback, automated quality gates, immutable artifacts, infrastructure as code, and the ability to rollback any change within minutes.