DevOps & Infrastructure Questions
𝐆𝐞𝐧𝐞𝐫𝐚𝐥 𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧𝐬
1. What is DevOps, and why is it important?
A: DevOps is a set of practices that combines software development and IT operations to shorten the development lifecycle while delivering features, fixes, and updates frequently and reliably.
2. How does DevOps differ from traditional IT practices?
A: DevOps emphasizes collaboration, automation, and continuous delivery, whereas traditional IT often involves siloed teams and manual processes.
3. What are the benefits of continuous integration and continuous deployment (CI/CD)?
A: CI/CD enables faster delivery, improved code quality, automated testing, and reduced deployment risks.
4. What tools are commonly used in DevOps?
A: Common tools include Git, Jenkins, Docker, Kubernetes, Terraform, Ansible, and monitoring tools like Prometheus and Grafana.
5. Describe a basic software development lifecycle (SDLC).
A: SDLC typically includes planning, analysis, design, implementation, testing, deployment, and maintenance phases.
𝐋𝐢𝐧𝐮𝐱 𝐁𝐚𝐬𝐢𝐜𝐬
1. How do you check the current directory in Linux?
A: Use the 'pwd' command to print working directory.
2. Command to list files and directories?
A: Use 'ls' command. Common options include 'ls -l' for detailed list and 'ls -a' to show hidden files.
3. How do you check running processes in Linux?
A: Use 'ps' command or 'top' for real-time process monitoring.
4. What is the difference between chmod and chown?
A: chmod changes file permissions, while chown changes file ownership.
5. Explain the purpose of cron jobs?
A: Cron jobs are scheduled tasks that run automatically at specified intervals for routine maintenance and automation.
𝐆𝐢𝐭 𝐚𝐧𝐝 𝐕𝐞𝐫𝐬𝐢𝐨𝐧 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
1. What is Git, and why is it used?
A: Git is a distributed version control system used to track changes in source code during software development.
2. What is the difference between git pull and git fetch?
A: git fetch downloads changes but doesn't merge them, while git pull downloads and automatically merges changes.
3. How do you create a branch in Git?
A: Use 'git branch branch_name' to create and 'git checkout branch_name' to switch to the new branch.
4. What is the purpose of the staging area in Git?
A: The staging area is a preparation area where changes are reviewed before committing to the repository.
5. How do you resolve merge conflicts?
A: Manually edit conflicting files, choose desired changes, then commit the resolved files.
𝐂𝐈/𝐂𝐃 𝐁𝐚𝐬𝐢𝐜𝐬
1. What is a CI/CD pipeline?
A: A series of automated steps that code goes through from development to production, including building, testing, and deployment.
2. Explain the role of Jenkins in CI/CD.
A: Jenkins is an automation server that helps build, test, and deploy code through automated pipelines.
3. What is the difference between scripted and declarative pipelines?
A: Scripted pipelines use Groovy scripting, while declarative pipelines use a more structured and predefined syntax.
4. What is the importance of artifact storage in CI/CD?
A: Artifact storage maintains build outputs, ensures version control, and enables reliable deployments across environments.
5. How does GitLab CI/CD differ from Jenkins?
A: GitLab CI/CD is integrated with GitLab and uses YAML configuration, while Jenkins is standalone and more customizable.
𝐂𝐨𝐧𝐭𝐚𝐢𝐧𝐞𝐫𝐢𝐳𝐚𝐭𝐢𝐨𝐧 𝐰𝐢𝐭h 𝐃𝐨𝐜𝐤𝐞𝐫
1. What is Docker, and why is it used?
A: Docker is a platform for developing, shipping, and running applications in containers, providing consistency across environments.
2. How do you create a Docker image?
A: Use a Dockerfile to define the image and run 'docker build' command to create it.
3. Explain the difference between a container and a virtual machine.
A: Containers share the host OS kernel and are more lightweight, while VMs include a complete OS copy and are more isolated.
4. What is a Dockerfile?
A: A Dockerfile is a text file containing instructions to build a Docker image automatically.
5. How do you check running containers in Docker?
A: Use the 'docker ps' command to list all running containers.
𝐈𝐧𝐟𝐫𝐚𝐬𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞 𝐚𝐬 𝐂o𝐝𝐞 (𝐈𝐚𝐂)
1. What is Terraform, and why is it popular in DevOps?
A: Terraform is an IaC tool that allows declarative infrastructure management across multiple cloud providers.
2. What does terraform init do?
A: Initializes a working directory containing Terraform configuration files and downloads required providers.
3. What is the purpose of a state file in Terraform?
A: The state file tracks the current state of infrastructure and helps Terraform plan and apply changes accurately.
4. How do you handle sensitive data in Terraform?
A: Use variables marked as sensitive, encrypted state files, and secure backends like HashiCorp Vault.
5. Difference between terraform plan and terraform apply?
A: terraform plan shows proposed changes without executing them, while terraform apply implements the changes.
𝐂𝐥o𝐮𝐝 𝐁𝐚𝐬𝐢𝐜𝐬
1. What is cloud computing?
A: Cloud computing is the delivery of computing services over the internet, including servers, storage, databases, and more.
2. Explain the difference between IaaS, PaaS, and SaaS.
A: IaaS provides infrastructure, PaaS provides development platforms, and SaaS provides complete software solutions.
3. What is AWS EC2, and why is it used?
A: EC2 is Amazon's virtual server service used to host applications and workloads in the cloud.
4. What is an S3 bucket?
A: S3 bucket is Amazon's object storage service for storing and retrieving any amount of data.
5. How does horizontal scaling differ from vertical scaling?
A: Horizontal scaling adds more machines to handle load, while vertical scaling adds more resources to existing machines.