DevOps

1. What is DevOps?

  • Definition:
    Dev (Developers) + Ops (Operations) → A culture, practice, and toolset that enables faster, reliable software delivery through collaboration, automation, and continuous improvement.
  • Simple Analogy:
    • Old Way: Developers “build the car,” throw the keys to Operations → chaos, delays.
    • DevOps Way: Developers and Operators work together from the start → smooth, automated, faster delivery.

2. Key Principles

PrincipleSimple IdeaExplanation
CollaborationBreak silosDev, Ops, QA, and Security work together throughout the lifecycle.
AutomationAutomate repetitive tasksBuilds, testing, deployment, infra setup → faster, error-free.
CI (Continuous Integration)Frequent mergesCode integrated and tested frequently → avoids “integration hell.”
CD (Continuous Delivery/Deployment)Always ready to releaseDelivery → human approval; Deployment → automatic production release.
Monitoring & FeedbackWatch and learnReal-time performance, logs, metrics → continuous improvement.
Customer ValueDeliver value fastFocus on customer needs, shorten idea-to-release time.
Shared ResponsibilityOwn the product end-to-endTeams are accountable from build to operations.

3. DevOps Tool Categories

CategoryPurposeExamples
Version Control (VCS)Track and manage code changesGit, GitHub, GitLab, Bitbucket
CI/CDAutomate build, test, deploymentJenkins, GitLab CI, GitHub Actions, CircleCI, Travis
ContainerizationPackage apps with dependenciesDocker, Podman
OrchestrationManage containers at scaleKubernetes, Docker Swarm
Infrastructure as Code (IaC)Automate infra setupAnsible, Terraform, Chef, Puppet
Monitoring & LoggingSystem health and insightsPrometheus, Grafana, ELK Stack, Nagios, Zabbix
TestingAutomate testingSelenium, JUnit, TestNG
Cloud ServicesScalable infra platformsAWS, Azure, GCP

4. Core DevOps Concepts

ConceptKey IdeaMnemonic
CIFrequent merges, automated builds & tests“Frequent merges = smooth releases”
CD (Delivery)Always ready for release“Deployable anytime”
CD (Deployment)Automatic production release“Zero human click deploys”
IaCInfra managed via code for consistency“Infra = Code”
ObservabilityReal-time logs, metrics, traces“Know what’s running”
Shift-Left SecurityAdd security early in the process“Security is everyone’s job”
AutomationRemove manual work“If it’s repeatable, script it”
Feedback LoopsMonitor, learn, adapt“Fast feedback = fast fixes”

5. DevOps Pipeline (Stages)

StagePurposeTools
PlanDefine features & goalsJira, Trello, Azure Boards
CodeWrite and review codeGit, GitHub, GitLab, VS Code
BuildCompile and packageJenkins, GitLab CI, Docker
TestAutomated & manual testingSelenium, JUnit, SonarQube
ReleaseStage for productionNexus, Artifactory
DeployPush to productionKubernetes, Terraform, Ansible
OperateManage live systemsAWS, Azure, GCP consoles
MonitorTrack health, metrics, logsPrometheus, Grafana, ELK, Splunk

Infinite Loop: Plan → Code → Build → Test → Release → Deploy → Operate → Monitor → Feedback → Repeat.


6. Common DevOps Practices

  • Version Control (Git)
  • Automated Testing (Selenium, JUnit)
  • Infrastructure Automation (Ansible, Terraform)
  • Monitoring & Logging (ELK, Prometheus)
  • CI/CD Pipelines (Jenkins, GitHub Actions)

7. Benefits of DevOps

  • Faster delivery
  • Higher quality software
  • Better collaboration
  • Early bug detection
  • Reduced manual effort

8. Challenges

  • Resistance to cultural change
  • Shortage of skilled professionals
  • Complex tool integration
  • Security risks in pipelines

9. Cloud and DevOps

Cloud ServiceAWSAzureGCP
StorageS3Blob StorageGCS
ProcessingEMRAzure DevOps, DatabricksDataProc
Container ServicesEKSAKSGKE

Cloud enables scalability, flexibility, and cost-efficiency for DevOps workflows.


10. Key Terms

TermDefinition
Blue-Green DeploymentTwo environments → zero downtime switch.
Canary DeploymentRelease to a small % of users first.
Rolling DeploymentGradual update rollout.
GitOpsManaging infra using Git as the single source of truth.

11. Popular Exam Topics

  • CI/CD lifecycle
  • Tools and their purposes
  • Infrastructure as Code concepts
  • Docker vs VMs (containers are lightweight, VMs are heavy)
  • Git basic commands

12. Command Cheat Sheet

Git

CommandPurpose
git initStart repo
git clone URLCopy remote repo
git add .Stage changes
git commit -m "msg"Commit changes
git pushUpload commits
git pullSync local with remote
git branch / git checkoutBranch management

Docker

CommandPurpose
docker build -t name .Build image
docker run -p 80:80 nameRun container
docker psList running containers
docker stop idStop container
docker exec -it id /bin/bashAccess container shell

Kubernetes

CommandPurpose
kubectl get podsList pods
kubectl apply -f file.yamlDeploy/update resources
kubectl delete -f file.yamlDelete resources
kubectl logs pod-nameView pod logs
kubectl exec -it pod-name -- /bin/bashAccess pod shell
kubectl scale deployment name --replicas=nScale pods

13. Last-Minute Tips

  • Remember core pipeline stages and tools.
  • Understand IaC and Automation concepts.
  • Know Docker and Kubernetes basics.
  • Practice basic commands for Git, Docker, and Kubernetes.
  • Focus on feedback loops and continuous improvement.

MCQ

1. What does DevOps stand for?

  • a) Development Optimization Services
  • b) Development and Operations
  • c) Developer Options
  • d) Deployment Operations

2. Which of the following is NOT a DevOps principle?

  • a) Automation
  • b) Continuous Feedback
  • c) Isolated Teams
  • d) Collaboration

3. Which tool is primarily used for continuous integration?

  • a) Jenkins
  • b) Kubernetes
  • c) Docker
  • d) Ansible

4. What is the main purpose of containerization in DevOps?

  • a) To automate code testing
  • b) To manage infrastructure as code
  • c) To create lightweight and portable application environments
  • d) To provide version control for code

5. Which tool is used for container orchestration?

  • a) Docker
  • b) Kubernetes
  • c) Terraform
  • d) Git

6. What does CI/CD stand for?

  • a) Continuous Integration/Continuous Deployment
  • b) Continuous Infrastructure/Continuous Delivery
  • c) Cloud Integration/Cloud Deployment
  • d) Code Integration/Code Development

7. Which DevOps tool is used for infrastructure automation?

  • a) Nagios
  • b) Terraform
  • c) Selenium
  • d) Prometheus

8. Which of the following is NOT a DevOps practice?

  • a) Continuous Monitoring
  • b) Continuous Integration
  • c) Manual Testing
  • d) Infrastructure as Code

9. What is the primary role of version control systems like Git in DevOps?

  • a) Automating deployments
  • b) Monitoring performance
  • c) Tracking changes in code
  • d) Orchestrating containers

10. Which of the following tools is used for monitoring in DevOps?

  • a) Jenkins
  • b) Nagios
  • c) Ansible
  • d) Docker

11. What is the purpose of the docker-compose tool?

  • a) To build Docker images
  • b) To manage multiple containers as a single application
  • c) To monitor container performance
  • d) To deploy containers on Kubernetes

12. What is the main benefit of using Infrastructure as Code (IaC)?

  • a) Reduces collaboration effort
  • b) Ensures manual configuration of servers
  • c) Enables consistent and repeatable infrastructure setup
  • d) Increase code compilation speed

13. What does the kubectl command do?

  • a) Manages Docker images
  • b) Deploys and manages Kubernetes clusters
  • c) Monitors system logs
  • d) Configures CI/CD pipelines

14. Which of the following is a Continuous Monitoring tool?

  • a) Jenkins
  • b) Prometheus
  • c) Docker
  • d) Git

15. Which deployment strategy involves two environments, one active and one idle?

  • a) Rolling Deployment
  • b) Blue-Green Deployment
  • c) Canary Deployment
  • d) Recreate Deployment

16. What is the main purpose of a CI/CD pipeline?

  • a) To manage virtual machines
  • b) To integrate and deliver code changes automatically
  • c) To replace manual code development
  • d) To design container images

17. Which of the following is NOT a feature of Kubernetes?

  • a) Automatic scaling
  • b) Service discovery
  • c) Continuous Integration
  • d) Load balancing

18. What is the command to initialize a Git repository?

  • a) git start
  • b) git init
  • c) git clone
  • d) git push

19. What is Ansible primarily used for?

  • a) Container orchestration
  • b) Infrastructure automation
  • c) Application monitoring
  • d) Code testing

20. What is a “Canary Deployment”?

  • a) Gradual rollout of new features to a subset of users
  • b) Deploying a new application version to all users immediately
  • c) Using containers for deployment
  • d) Deploying applications without downtime

21. Which of the following commands lists running Docker containers?

  • a) docker list
  • b) docker ps
  • c) docker show
  • d) docker run

22. What does the git pull command do?

  • a) Pushes local changes to the remote repository
  • b) Pulls changes from the remote repository to the local repository
  • c) Deletes files from the repository
  • d) Clones a repository

23. Which tool is best suited for container security scanning?

  • a) Prometheus
  • b) Jenkins
  • c) Docker Bench
  • d) Nagios

24. What is the purpose of the Helm tool in Kubernetes?

  • a) To automate CI/CD pipelines
  • b) To monitor Kubernetes nodes
  • c) To manage Kubernetes applications using charts
  • d) To create Docker images

25. Which of the following is a benefit of using DevOps?

  • a) Increased software delivery speed
  • b) Isolated team silos
  • c) Reduced need for collaboration
  • d) Longer development cycles