Skip to main content

Command Palette

Search for a command to run...

🚀 Day 29 – Mock Interview: 50 Questions + Detailed Answers

Updated
•7 min read
🚀 Day 29 – Mock Interview: 50 Questions + Detailed Answers

Series: 30 Days DevOps Interview Preparation
Author: Tathagat Gaikwad

Welcome to Day 29 of the 30 Days of DevOps Interview Preparation Challenge! 🎯
Today, we are simulating a mock interview with 50 real questions that a 1–3 YOE (Years of Experience) DevOps/SRE/Cloud Engineer might face. Each question is paired with a theoretical explanation and a detailed answer to help you build strong confidence.


🔹 Linux & Basics

1. What is the difference between a process and a thread?

  • A process is an independent unit of execution with its own memory space.

  • A thread is a lightweight execution unit within a process that shares memory and resources.
    ✅ Threads are faster, but processes are more isolated.

2. How do you check which process is consuming high CPU in Linux?
Use top, htop, or ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu.
✅ This lists processes sorted by CPU usage.

3. What is the difference between hard link and soft link?

  • Hard link: Points directly to the inode; original and link are indistinguishable.

  • Soft link (symlink): A pointer to the file name. If the target is deleted, the symlink breaks.
    ✅ Example: ln file1 file2 (hard link), ln -s file1 file2 (soft link).

4. How does the ping command work internally?
It uses ICMP protocol (layer 3, network layer) to send Echo Request and waits for Echo Reply.
✅ Helps test reachability and round-trip time.

5. What are inodes in Linux?
Inodes store metadata (file size, permissions, timestamps, block location) but not the filename.
✅ File names are stored in the directory entry.


🔹 Git & Version Control

6. How do you revert a commit in Git?
Use git revert <commit_id> → Creates a new commit that undoes the changes.
✅ Different from git reset which rewrites history.

7. What is the difference between git fetch and git pull?

  • git fetch: Downloads changes but doesn’t merge.

  • git pull: Fetches + merges into current branch.

8. How do you resolve merge conflicts in Git?
Edit conflict markers in the file, choose changes, then:

git add <file>
git commit

9. Explain Git branching strategy (GitFlow vs Trunk Based).

  • GitFlow: Separate branches for feature, release, hotfix. Good for complex projects.

  • Trunk Based: Small commits merged into main quickly. Good for CI/CD.

10. What’s the difference between git merge and git rebase?

  • Merge: Creates a new commit combining histories.

  • Rebase: Moves commits to the tip of another branch for a cleaner history.


🔹 CI/CD

11. What is Continuous Integration and Continuous Delivery?

  • CI: Developers frequently merge code into main branch; automated builds/tests validate it.

  • CD: Ensures tested code is automatically deployable to staging/production.

12. Difference between Jenkins and GitHub Actions?

  • Jenkins: Open-source, plugin-rich, requires hosting.

  • GitHub Actions: Cloud-native, tightly integrated with GitHub repos.

13. How do you secure secrets in CI/CD pipelines?

  • Use secret managers (Vault, AWS Secrets Manager, GitHub Secrets).

  • Never hardcode credentials.

  • Rotate and audit keys.

14. How to trigger a pipeline only on main branch?
Example in GitHub Actions:

on:
  push:
    branches:
      - main

15. Explain the concept of Blue-Green Deployment.
Two environments (Blue\=current, Green\=new). Traffic switches to Green after validation.
✅ Reduces downtime and rollback is easier.


🔹 Docker & Containers

16. What is the difference between Docker image and Docker container?

  • Image = blueprint (read-only).

  • Container = running instance of an image.

17. What happens when you run docker run -d nginx?
Docker pulls image (if not present), creates a container, runs it in detached mode.

18. How do you reduce Docker image size?

  • Use smaller base images (e.g., alpine).

  • Multi-stage builds.

  • Clean package caches.

19. What is a Docker volume?
Persistent storage that lives outside containers.
✅ Example: docker run -v mydata:/data alpine

20. Difference between Docker Compose and Kubernetes?

  • Docker Compose: Local multi-container orchestration.

  • Kubernetes: Production-grade container orchestration.


🔹 Kubernetes

21. Difference between Deployment, StatefulSet, and DaemonSet?

  • Deployment: Stateless apps.

  • StatefulSet: Stateful apps (databases).

  • DaemonSet: Runs one pod per node (monitoring/logging agents).

22. What is a Kubernetes namespace?
A logical partition to isolate resources.
✅ Helps multi-team clusters.

23. How do you scale pods in Kubernetes?

kubectl scale deployment nginx --replicas=5

Or use HPA (Horizontal Pod Autoscaler).

24. Explain readiness probe vs liveness probe.

  • Readiness probe: Checks if pod is ready to serve traffic.

  • Liveness probe: Checks if pod is still alive or needs restart.

25. What is the difference between NodePort, ClusterIP, and LoadBalancer service?

  • ClusterIP: Internal access only.

  • NodePort: Exposes service on every node’s IP:Port.

  • LoadBalancer: Provisioned cloud load balancer.


🔹 Terraform & IaC

26. What is Infrastructure as Code (IaC)?
Managing infra using machine-readable config files instead of manual setup.

27. What’s the difference between terraform apply and terraform plan?

  • plan: Shows what will change.

  • apply: Executes the changes.

28. How do you manage Terraform state in teams?

  • Use remote backends (S3 + DynamoDB, Terraform Cloud).

  • Lock state to prevent conflicts.

29. What is a Terraform module?
A reusable set of Terraform configs grouped together.

30. Explain terraform import.
It imports existing infra into Terraform state.


🔹 Cloud (AWS/Azure/GCP)

31. Difference between Load Balancer and API Gateway?

  • Load Balancer: Distributes traffic to servers.

  • API Gateway: Manages API requests, rate-limiting, auth.

32. What is Auto Scaling?
Automatically adjusts compute capacity based on demand.

33. What is the difference between S3 and EBS?

  • S3: Object storage, infinite scalability.

  • EBS: Block storage, tied to EC2.

34. How do you secure credentials in AWS?

  • Use IAM roles instead of keys.

  • Store in AWS Secrets Manager/SSM.

  • Rotate regularly.

35. What are IAM roles and policies?

  • Roles: Temporary credentials for AWS resources.

  • Policies: JSON docs defining permissions.


🔹 Monitoring & Logging

36. Difference between Prometheus and Grafana?

  • Prometheus: Metrics collection + alerting.

  • Grafana: Visualization/dashboarding.

37. How do you set up alerts for high CPU utilization?

  • Define Prometheus alert rule.

  • Send to Alertmanager → Slack/Email.

38. What is log aggregation?
Centralizing logs (e.g., ELK/EFK stack) for analysis.

39. Explain distributed tracing.
Tracking a request across multiple services (Jaeger, Zipkin).
✅ Helps troubleshoot microservices.

40. How would you troubleshoot high latency in an application?

  • Check app logs.

  • Monitor CPU/memory/network.

  • Use APM tools (Datadog, New Relic).


🔹 Networking & Security

41. What is the difference between TCP and UDP?

  • TCP: Reliable, connection-oriented.

  • UDP: Faster, connectionless, no guarantee.

42. Explain the concept of a reverse proxy.
A server that forwards client requests to backend servers (e.g., Nginx).

43. What is DNS and how does it work?
DNS translates domain names → IP addresses.
Steps: Resolver → Root → TLD → Authoritative server.

44. What is the difference between a VPN and a VPC?

  • VPN: Secure private connection over the internet.

  • VPC: Isolated virtual network inside cloud.

45. How do you secure communication between microservices?

  • Use mTLS (mutual TLS).

  • Service mesh (Istio, Linkerd).

  • API Gateway with auth.


🔹 Behavioral & Scenario-based

46. Tell me about a time you fixed a major production issue.
✅ Use STAR (Situation, Task, Action, Result). Example: Fixed downtime by scaling pods + optimizing DB query.

47. How do you prioritize multiple incidents happening at once?

  • Severity-based triage.

  • Critical issues first.

  • Communicate with stakeholders.

48. How do you handle conflict between development and operations teams?

  • Promote blameless culture.

  • Use monitoring + automation to reduce manual errors.

  • Encourage DevOps mindset.

49. If a deployment fails, what are your next steps?

  • Check pipeline logs.

  • Rollback to stable version.

  • Run root cause analysis (RCA).

50. How do you keep yourself updated with new DevOps tools and practices?

  • Blogs, newsletters (DevOps.com, CNCF).

  • Hands-on labs (Katacoda, KodeKloud).

  • Community groups & meetups.


✨ Final Tips

  • Practice answers with real-world project examples.

  • Don’t memorize, understand concepts.

  • Communicate clearly in interviews.

  • Review this list multiple times before interviews.

💡 Tomorrow (Day 30), we’ll wrap up this challenge with a final revision strategy + resources 🎯

More from this blog

Cloud Enthusiast

116 posts