Top 10 DevOps Interview Questions

I have listed down top 10 DevOps interview questions on few topics like, Git, Maven, Jenkins, Docker, Kubernetes, Ansible.

  1. What is the need for DevOps?
  2. What is meant by Continuous Integration?
  3. What is the difference between Continuous Delivery vs Continuous Deployment?
  4. How is devOps different from Agile/SDLC?

Git:

  1. What is the need of Git? What is the difference between Git vs Github?
  2. How to create a new branch in Git? 
  3. What is the branching and merging Strategy you are following in your company?
  4. How will you resolve the conflict in Git?
  5. Difference between git pull vs git fetch?
  6. How to revert un-pushed changes in Git?
  7. How to update the last commit message in git?
  8. How to update the second last commit message in git? ( Hint: using git rebase)
  9. How will you merge changes from one branch to another branch?
  10. How to merge multiple sequence commits into a single commit in git? ( Hint : git squash)

Maven

  1. What is Maven?
  2. What aspects are managed by Maven?

( Hint: Builds, Documentation, Reporting,SCMs,Releases,Distribution)

  1. What is the command to install the JAR file in a local repository?

( Hint: mvn install )

  1. What is difference b/w mvn install vs mvn package
  2. What is the purpose of the mvn clean command?
  3. What is POM?
  4. What are the build phases in Maven?
  5. What is a Maven artifact?
  6. Name the three build lifecycle of Maven.
  7. What is a Maven Repository and types of Maven repository?

Jenkins 

  1. What is Jenkins ? How will you use Jenkins to automate CI/CD ?
  2. How to configure your Github or Bitbucket repository to trigger the build when any changes happen in code ? Please explain all types of Build Trigger In Jenkins?
  3. Explain End to End java application Pipeline?
  4. How will you configure Junit to run the test with Jenkins Pipeline ?
  5. How to integrate the Selenium test with Jenkins Pipeline ?
  6. What are the differences between Jenkins and TeamCity ?
  7. How to configure slave nodes in Jenkins ?
  8. What is the difference between declarative and scripted pipeline ?
  9. Where to store the global credentials in jenkins??
  10. How does your UAT build trigger when your Dev build completes? How did you configure the dependency ? 

Docker

  1. How to stop all docker containers?

docker kill $(docker ps -q)

  1. How to stop docker containers and remove them?

docker rm $(docker ps -a -q)

  1. How to remove all Docker Images?

docker rmi $(docker images -q)

  1. Remove all exited containers

List: docker ps -a -f status=exited

Remove: docker rm $(docker ps -a -f status=exited -q)

  1. Remove containers using more than one filter

List: docker ps -a -f status=exited -f status=created

Remove: docker rm $(docker ps -a -f status=exited -f status=created -q)

  1. Remove containers according to a pattern

List: docker ps -a | grep “pattern”

Remove: docker ps -a | grep “pattern” | awk ‘{print $1}’ | xargs docker rm

  1. Remove one or more specific volumes

List: docker volume ls

Remove: docker volume rm volume_name

  1. Remove dangling volumes

List: docker volume ls -f dangling=true

Remove: docker volume prune

  1. Remove a container and its volume

docker rm -v container_name

  1. How to create a multistage Dockerfile?  What is benefit of Multi-Layer Docker file ?
  2. What are the benefits of a Container platform over a Virtual machine?  
  3. Can we run multiple containers within a single pod? What are the use cases when we should use it?  

Ansible

  1. What is Roles in Ansible?
  2. What are the uses of ansible templates? 
  3. Write an ansible playbook to deploy the Apache in DEV, UAT and PROD environment? 
  4. Write down Ansible playbook to install Ngnix server?
  5. What are the advantages of Ansible over other configuration management tools? 
  6. How can you run ansible tasks from root user? 
  7. What is a handler and how can we use it in Ansible ? 
  8. Can we create generic playbook to install software/package in Debian and CentOS?https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html
  9. How do you access Shell Environment Variables?
  10. How to keep sensitive configuration in Ansible? ( Hint : Check ansible vault)

Kubernetes 

  1. What types of Services are present in Kubernetes ? 
  2. What are the roles of master and data nodes in Kubernetes ? 
  3. What are the advantages to having a namespace in any cloud platform? 
  4. If any application requires web application code, database then how will they communicate to each other? 
  5. When any pods die and it creates a new pod automatically then what all events happened in the backend to bring the pod back?
  6. How to configure auto-scaling in Kubernetes?

https://kubernetes.io/blog/2016/07/autoscaling-in-kubernetes/

  1. How do pods communicate internally in Kubernetes? 
  2. How to expose your web-application to the external world? 
  3. Difference between Ingress and Ingress controller?
  4. Can you explain the differences between Docker Swarm and Kubernetes?

Basic Linux and Bash Scripting

  1. How to check processes which are taking more memory and CPU? 
  2. How to check which files/directory are taking more space?
  3. Please tell us how you will check if a file exists on the filesystem?

References:

https://github.com/roopendra/devops-interview-questions-answers

(Visited 240 times, 4 visits today)