100+ DevOps Interview Questions You Must Prepare To Get Job

Shares

DevOps Interview Questions and Answers [Table of Contents]

DevOps Interview Questions for Basic Introduction

  1. What is the Scope of DevOps and Why do we need?
  2. Can you provide an overview of DevOps phases?
  3. Why is DevOps gaining more popularity?
  4. What are the Key differences between DevOps & Agile?
  5. Describe the core business and technical benefits of DevOps?
  6. What are the most-used DevOps tools?
  7. What do you Know About anti-patterns of DevOps?
  8. What are CI and its main purpose? 
  9. Do You Know About the shift left in DevOps?
  10. What does CAMS stand for?
  11. Enlist some of the KPIs used to measure DevOps’ success?
  12. What are the Core Benefits of DevOps automation?
  13. What do you think about containers?
  14. Enlist the two java development frameworks used for creating microservices? 
  15. Do you know about the post mortem meetings?
  16. Can you differentiate Asset Management and Configuration Management?
  17. What is “Infrastructure as Code” (IaC) and how does it relate to configuration management?
  18. Can you explain several key elements of continuous testing?
  19. How can you maintain the entire architecture using continuous monitoring? 
  20. What are the core operations of DevOps according to development and infrastructure?
  21. Can you define the role of AWS in DevOps?
  22. How is “Infrastructure as Code” implemented using AWS?
  23. What do you know about DevOps?
  24. What is the basic rule or idea of DevOps?
  25. Is DevOps related to any other methodology?
  26. Can you tell me about the priorities in DevOps?
  27. What are the key benefits of DevOps?
  28. What is (CI) continuous integration?
  29. Can You Explain the Difference Between continuous testing and automation testing?
  30. Do you know about the key differences between continuous delivery and continuous deployment?
    1. DevOps Interview Questions related to Source Code Management — Git
  31. What are the advantages of Git?
  32. Can You handle merge conflict in Git?
  33. Do You Know About Forking Workflow?
  34. Which one is better Forking Workflow or Git Workflow?
  35. Can you Define Git rebase?
  36. Can You Define Git stash?
  37. What is branching in Git?
  38. How is Git rebase different from Git merge?
  39. What are the advantages of using VCS? 
  40. How can we revert a commit in Git that has been pushed and made public?
  41. What is the difference between a centralized and distributed version control system (VCS)?
  42. Do You Know the git command for downloading any repository from GitHub to your computer?
  43. How can you push a file from your computer to the GitHub repository?
  44. Which CLI command is used to rename the files?
  45. Do you know the difference between Git fetch and Git pull?
  46. Can you enlist the uses of a Version Control System (VCS)? 
  47. Is it possible to secure Jenkins?
  48. Can you define the Jenkins Pipeline?
  49. Explain the key aspects of the Jenkins pipeline?
  50. Do you know about the Jenkinsfile?
  51. Can you tell the file name that is used to define dependency in Maven?
  52. Which command is used to run the Jenkin? 
  53. Is it possible to move or copy Jenkins from one server to another?
  54. How Can we make a new copy of an existing Jenkins job?
  55. Can You Explain the master-slave architecture of Jenkins?
  56. Explain the two types of pipeline and their syntax.
  57. How to create a backup and copy files in Jenkins? 
  58. Define three security mechanisms Jenkins uses to authenticate users.
  59. Have you understood how a custom build core plugin deployed?
  60. What are the different ways in which a build can be scheduled/run in Jenkins?
  61. How can you restart Jenkins manually?
    1. DevOps Interview Questions for Continuous Testing – Selenium
  62. Why is Selenium used?
  63. Why is the Selenium Grid used?
  64. What are the major components of Selenium?
  65. Briefly explain the different exceptions in Selenium WebDriver?
  66. Can we test an application on an Android browser with the help of Selenium?
  67. Do You know about the different test types that Selenium supports?
  68. Can we access the text of a web element if yes then how?
  69. Which one is not a WebElement method?
  70. What is the purpose of findElement() and findElements()?
  71. What are driver.close() and driver.quit() in Selenium WebDriver?
  72. How can we submit a form using Selenium?
    1. DevOps Interview Questions related to Configuration Management — Chef, Puppet, Ansible
  73. Can you explain Why are SSL certificates used in Chef?
  74. What is Test Kitchen in Chef and the most commonly used commands for this purpose?
  75. You want to disable or stop the “httpd” service, which of the following command is correct? 
  76. Differentiate both chef-apply and chef-client?
  77. Do you know about the Puppet Module?
  78. What is the difference between Puppet Module and Puppet Manifest?
  79. What are the major differences between Ansible and Puppet?
  80. Can you explain the Puppet in DevOps?
  81. Do you know about any tool to make Puppet more powerful?
  82. What are the resources used in Puppet?
  83. Can You explain a class in Puppet?
  84. Have you listened about Ansible work?
  85. Can You tell us what are the categories of Ansible in DevOps?
  86. Is it possible to install Ansible on the controlling machines?
  87. What are the benefits of the Ansible agentless tool? 
  88. What is an Ansible role in DevOps?
  89. When should we use ‘{{ }}’?
  90. How to make content reusable/redistributable?
    1. DevOps Interview Questions on Containerization
  91. What is the architecture of Docker?
  92. What are the major benefits of Docker over virtual machines?
  93. How do you share Docker containers with different nodes?
  94. How to create a Docker swarm with the help of commands?
  95. Is it possible to run multiple containers using a single service?
  96. Why do we need a Docker file?
  97. What are the main differences between Docker images and Docker containers?
  98. How to create a Docker container?
  99. Enlist the differences between a registry and a repository?
  100. What are the names of different cloud platforms that support Docker?
  101. What do you know about the expose and publish commands in Docker?

DevOps stands for Development and Operations is a well-renowned software development practice that most of the organizations adopt into their workflow. With the help of DevOps, the development and distribution of software products are revolutionized. According to Forrester (a top research firm), more than 50% of the organization has implemented and expanding whereas 27% are planning to implement in the near future. Biggest enterprises such as Google, Facebook, Amazon, or Netflix have implemented and opening multiple positions for DevOps engineers. There is no doubt that the job listing is increasing but the job market is highly competitive where you have to cover different challenging subjects for DevOps interview questions. Keep in mind, you can’t get a job without preparing DevOps questions.

In fact, jobs related to the DevOps become the most promising career choices for the professionals. But keep in mind organizations are enhancing their output by hiring only the applicants having in-depth knowledge, skills, and certifications. It is mandatory to understand basic knowledge and DevOps interview questions before getting enrolled in the certifications that are not compulsory for getting a job but it can help you to prove your skills.  So, the aim of this article is to help those candidates to boost their knowledge with a number of questions asked by the industry experts. 

Every DevOps engineer should be fluent in web languages like PHP, Java, or Python with the experience of infrastructure automation tools like Windows PowerShell DSC, Puppet, or Chef and interpersonal skills for better collaboration and communication. 

DevOps Interview Questions and Answers 

DevOps Interview Questions Related To Basic Introduction

1. What is the Scope of DevOps and Why do we need?

In this digital world, the processes are changed and organizations are transporting small features to their valuable customers instead of releasing a big feature set. There are many benefits of using this method including quick customer better quality and feedback. The main goal of any product development project is customer satisfaction, so any organization needs the following things to achieve this goal:

  • The minimum failure rate of new releases  
  • Faster mean time to recovery in case of crashing
  • Increase development frequency 
  • Lower time for fixes 

DevOps helps to fulfill all these requirements and facilitate the company to achieve seamless software delivery. Well-renowned and big organizations like Google and Amazon have adopted this methodology and getting the highest performance levels with the ability to accomplish tens to thousands of deployments in a single day with security, stability, and reliability. 

2. Can you provide an overview of DevOps phases?

DevOps phases

There are mainly six phases in the DevOps. Planning, development, continuous integration, automated deployment, operations, and monitoring. Let’s understand each phase in more detail. 

Plan

The initial step in the DevOps lifecycle is planning that involves the understanding of the project for the ultimate work goal for its participants. It also feeds the different phases of development and operations. Moreover, planning is important for the clarity of project management tools and metrics. 

Code

Project development starts by designing infrastructure and coding the project. Programmers store their codes in a code manager at a central location where they can view and perform different operations. 

Build

Once the code of an application is completed, they build the application by integrating several codes written in the previous step. 

Test

Testing is a vital part of software application development. You can rebuild the application in case of any problem.  

Integrate

This phase involves the testing and validation to ensure either project is working properly or not. If everything is fine then published in a service that integrates with remaining applications. 

Deploy 

DevOps automates the deployments using tools and scripts to solve the whole process with the activation of a feature. It involves the cloud that provides infrastructure and cost optimization management. 

Operate

Almost all DevOps operations are happening throughout the life of software and provides the opportunities for scalability, availability, and transformation. 

Monitor

In order to check the current status of the application, DevOps permanently monitors and analyzes the information.  

3. Why is DevOps gaining more popularity?

It is a trending and in-demand industry because it helps the organizations to expand their businesses and earn an attractive amount of income. When most of the companies started to adopt this methodology then it becomes the most important for the competitors to implement better development practices. Multinational and big business brands including Facebook and Netflix are continually investing in DevOps automation to provide outstanding automation in the near future. 

Programmers and developers can develop applications within a record time period having higher efficiency. Nowadays, most of the online businesses are relying on cloud software that requires faster deployment without any interruptions and needs to adopt DevOps over the years. Interview questions on DevOps are not only provided for the beginners, they are equally beneficial for both newbies and experienced people.  

4. What are the Key differences between DevOps & Agile?

Both are based on different methodologies of the software development lifecycle (SDLC) but DevOps has some similarities with the Agile. DevOps interview questions are written to give you the conceptual answers for excellence. Let’s understand the DevOps and Agile with the help of a diagram. 

Agile methodology

DevOps is dedicated to facilitating the development and operations team to work together in continuous development, testing, integration, deployment, and monitoring of the software to create a great option throughout the lifecycle as you can see in the picture given below: 

Gap between software requirement and developer

Agile is a technique used for incremental, iterative, small and rapid releases of software with the help of customer feedback. You may experience the conflicts and gaps between the customers and developers. If we talk about the DevOps, then you may see the conflicts between developers and IT operations. 

Gap between developers and operations

Agile Approach: As you know, agile refers to an iterative approach focused on customer feedback, rapid releases, and better collaboration. So, the DevOps is a practice of bringing both development and operations teams together but it is only meant for development is agile. 

Practices and Processes: DevOps involves processes such as Continuous Delivery (CD), Continuous Integration (CI), and Continuous Testing (CT), and agile involves practices such as Agile Kanban and Agile Scrum.

Priority: DevOps provide equal priority to quality and timeliness but agile prioritizes only timeliness. 

Release Cycles: DevOps provides the option to proactively manage the project with smaller release cycles and immediate feedback but Agile offers only smaller release cycles without the option of immediate feedback.

Feedback Source: DevOps has feedback monitoring tools but Agile totally relies on the feedback from customers.

Scope of Work: For DevOps, the scope of work is agility and need for automation but agile has only agility. 

5. Describe the core business and technical benefits of DevOps?

DevOps has a lot of benefits, business and technical advantages are listed below: 

Business benefits

  • Faster delivery of features
  • Enhanced collaboration between teams
  • Improved operating environment stability
  • Better communication and time to add values

Technical benefits

  • Continuous software delivery
  • A great option for problem resolution
  • Reduced complex problems

6. What are the most-used DevOps tools?

  • Ansible, Puppet, and Chef – are the configuration management and application deployment tools
  • Docker – is a containerization tool
  • Selenium – is used for continuous testing (CT)
  • Git – For VCS (version control system) activities 
  • Jenkins – is used for continuous integration (CI) 
  • Jira – that provides the agile team collaboration option
  • Nagios – is used for continuous monitoring

7. What do you Know About anti-patterns of DevOps?

In a DevOps doesn’t work in a specific context then the organizations need to adopt an anti-pattern.  Following are the most popular anti-patterns: 

  • DevOps is a process
  • The company needs to have a separate DevOps group
  • Agile is equals DevOps
  • DevOps is development-driven release management
  • DevOps indicates Developers Managing Production
  • DevOps is responsible for solving all problems

8. What are CI and its main purpose? 

CI means Continuous Integration in which developers integrate their code into a shared repository several times a day. The main purpose of Continuous Integration is to enhance the quality and reduce the time required to complete the project. CI also has a suite of unit, integration, and regression testing that runs each time when compilation succeeds. 

9. Do You Know About the shift left in DevOps?

When the traditional development lifecycle drafted on the paper it has two sides, left and right. Design and development are presented on the left side and production staging, user acceptance and stress testing on the right side.

The shift left means taking the maximum of the tasks on the right-side that happens toward the end of the development process. It is used to find and prevent defects before the software delivery process. Incorporating static code analysis routines in every build and creating production-ready artifacts at the end of every Agile Sprint are the widely used ways of accomplishing shift-left. 

10. What does CAMS stand for?

  • Culture
  • Automation
  • Measurement
  • Sharing

11. Enlist some of the KPIs used to measure DevOps’ success?

Following are the most widely used Key Process Indicators: 

  • MTTD (Mean time to detection)
  • MTTR (Meantime to recovery)
  • Application performance
  • Application usage and traffic
  • Availability
  • Change volume
  • Deployment frequency
  • Error rates
  • Customer tickets
  • Defect escape rate
  • Failed deployments
  • Lead time

12. What are the Core Benefits of DevOps automation?

  • Reduce the human errors from the CD equation
  • Removes the bottlenecks from the CI pipeline
  • Identification of errors is much easier because tasks become more repeatable and predictable

13. What do you think about containers?

Containers use the virtualization technology and used to provide isolation among processes. These are not heavier than a hypervisor and lighter than a chroot

14. Enlist the two java development frameworks used for creating microservices? 

There are many Java development frameworks and IDEs including Eclipse MicroProfile and Spring Boot used to create microservices. 

15. Do you know about the post mortem meetings?

Yes, these are the meetings conducted in case if anything went wrong. The main purpose of these meetings is to finalize actions or planning to avoid the same errors in the near future. 

16. Can you differentiate Asset Management and Configuration Management?

Asset management is the process of monitoring and maintaining valuable things to an entity or group. Whereas, Configuration Management is a method used to control, identify, plan, and verify the configuration items within the service in support of change management. 

17. What is “Infrastructure as Code” (IaC) and how does it relate to configuration management?

It is a type of IT setup in which developers automatically manage and deliver applications through software instead of writing code to manage configuration, deployment and automatic provisioning. 

18. Can you explain several key elements of continuous testing?

Advanced analysis

These analyses are made to forecast and predict unknown future events

Policy analysis

different policies to improve the testing process 

Requirement traceability

As the name indicates, it is the process to enhance the ability to describe requirements from the initial stages to deployment. 

Risk assessment

At any stage, risks can be more dangerous and cause potential harm. So, risk assessment is used to identify the risk factors proactively.  

Service virtualization 

As the name indicates, it is the process of testing in which virtual services are used instead of production services. 

Test optimization

It is the process of improving the overall testing procedures.

19. How can you maintain the entire architecture using continuous monitoring? 

continuous monitoring

DevOps interview questions are more important for anyone to get a job in a well-reputed organization but they should appear in the interview with proper preparation. Continuous monitoring is the process of detecting, identifying, and reporting of threats in the entire system. 

  • Continuous monitoring ensures that all applications, resources and services are working properly.
  • It monitors the status of the server and determines all applications are running correctly or not. Moreover, it also enables the transaction inspection, control monitoring and continuous audit. 

20. What are the core operations of DevOps according to development and infrastructure?

DevOps coding interview questions are not as easy as many newbie engineers think. You can only pass your interview if you have proper and in-detailed information because every organization has many applicants for a single vacancy. According to development and infrastructure, the following are the core operations: 

Application development

Developing the products (software applications) to meet customer requirements and offering outstanding quality. 

Code coverage

When the automated tests run, it is the measurement of the total number of lines executed. 

Code developing

Writing and preparing the code required for application development. 

Configuration

It will allow the application or product to be used in the best way. 

Deployment 

Installation of software for real-time use.

Orchestration

It is the name of arranging several automated tasks.

Packaging

In this operation, individual files and resources are packed together when the release is ready for deployment. 

Provisioning

It provides the foundation for flexible infrastructure with dynamic resource allocation and ensures the changes arrived just-in-time with the code that requires it. 

Unit testing

It is a software development and testing approach used to test the smallest parts of any software application.

21. Can you define the role of AWS in DevOps?

Flexible services

Nowadays cloud-based services are more suitable for the changing needs of and growing business demands. Using managed AWS Cloud, there is no need to worry about any features to scale up or scale down your deployment. 

Scalability 

If you are using other traditional planning methods then it is quite possible to purchase extra servers, storages and other applications. So, cloud platforms allow dynamic scaling that is perfect for unpredictable business growth. 

Automation

AWS in the DevOps lets you automate tasks and processes, giving you more time to innovate

Data Security 

Everyone should understand what is data breach, common causes and prevention methods. Physical devices including hard drives, USBs, and laptops can be stolen or shattered. When AWS is used then data remains safe and secure. Moreover, with the help of AWS Identity and Access Management (IAM), you can set user permissions and policies.

22. How is “Infrastructure as Code” implemented using AWS?

IaC allows the programmers to write, test and maintain the code in a descriptive format like JSON or YAML and speed up the development and deployment of infrastructure changes. 

23. What do you know about DevOps?

DevOps is a set of practices that combines the (Dev) software development and (Ops) IT operations with the aim to provide continuous delivery and a higher level of quality. Both operation engineers and development team are working together from the initial stages to deployment. 

24. What is the basic rule or idea of DevOps?

It is a cultural shift where both operation and collaboration teams work together in the complete service life cycle. 

25. Is DevOps related to any other methodology?

Yes, it is related to Agile methodology. 

26. Can you tell me about the priorities in DevOps?

DevOps has resource management, communication and teamwork priorities. 

27. What are the key benefits of DevOps?

DevOps has many benefits including stability, innovation, speed and functionality. 

28. What is (CI) continuous integration?

Continuous integration is a development practice used to build, deploy, test and release software applications. In simple words, CI is a method of automating the integration of code changes into a single project where many contributors save their code at a single place many times a day. 

29. Can You Explain the Difference Between continuous testing and automation testing?

Automation testing is a process where testing is a separate tool and helps the programmers to create test scripts that can be executed again and again automatically. In contract, Continuous Integration is also an automated test but it is the part of software delivery process. 

30. Do you know about the key differences between continuous delivery and continuous deployment?

Continuous DeliveryContinuous Deployment
Used to safely deploy the code on the production environment Every change passed by the automated tests will be deployed to production automatically 
Business services and applications are functioning as expectedMakes software development and the release process faster 
CD Delivers change to a production-like environment with the help of automated testing No explicit approvals from developers and requires a developed culture of monitoring
differences between continuous delivery and continuous deployment

DevOps Interview Questions related to Source Code Management — Git

31. What are the advantages of Git?

Git has the following benefits: 

  • Helps in data redundancy and replication
  • Highly available and offers higher network performance 
  • Used for a variety of projects
  • Only one Git directory per repository
  • Supports collaboration and disk utilization

32. Can You handle merge conflict in Git?

Yes, I can handle merge conflict in Git with the help of following steps:

  • Checking everything using Git status
  • Cleanup the conflicts by applying merge tool
  • Performing commit and merging with the current branch along with master

33. Do You Know About Forking Workflow?

Forking workflow is different from other workflows because it gives every developer their own server-side repositories.  

34. Which one is better Forking Workflow or Git Workflow?

Forking workflow is better than Git workflow because the contribution of different developers is easily integrated without needing everybody to push to a central repository for cleaning project history. They only push their server-side repositories then the project container will push to the official repository. 

35. Can you Define Git rebase?

It is a command used to integrate the changes from one branch to another. 

36. Can You Define Git stash?

Consider a scenario, a programmer or developer is going to work on another branch but his current work is also uncompleted and he is not willing to commit the changes. The solution is Git Stash because it takes your modified files and saves them on a stack so that you can re-apply at any time. 

37. What is branching in Git?

When you want to add a new feature into an existing software application then you need to create a new branch and add the new features on that branch. Consider the following important things: 

  • By default, the programmer will work on the master branch 
  • Circles on the branch representing several commits made on the branch 
  • Once all changes are done, you can commit to merge your code in the master branch 
Git Branching

38. How is Git rebase different from Git merge?

If you are working on a dedicated branch and other team members update the master branch with changes (or new commits). You have the two options either use the Git merge or Git rebase. 

Git Rebase:

It includes all the new commits in the master branch and rewrites project history as you can view the picture given below:  

Git Merge: 

Whenever the programmers want to add new commits into a feature or main branch, they use git merge. It will create an extra merge commit every time you need to include changes but it pollutes your main branch history. 

Git Merge

39. What are the advantages of using VCS? 

Following are the key benefits of Version Control System:

  • All developers/programmers can access the file from anywhere anytime and merge the changes in a common version. 
  • It facilitates multiple users to work in a collaborative environment that makes the sharing of code very easy between multiple computers. 
  • It is more beneficial for the documents that need revisions and redrafting again and again. 
  • It saves the complete history and old versions of any project/document, so anyone can view the previous complete projects. 
  • In case of any disaster, all team members are freely working from anywhere. 

40. How can we revert a commit in Git that has been pushed and made public?

There are two ways to perform this task:

  • Create a new commit to undo all changes made by any commit that has been pushed and run the following command: 
    • git revert 
  • Try to fix the bad file in a new commit or remove these files and push it to the remote repository. Once all necessary changes are made, you can commit the repository with the following command: 
    • git commit -m “commit message”
  • Create a new commit that will be used to undoes all changes made in the bad commit. Use the following command:
    • git revert <name of bad commit>
    • For example: git revert 34df3454f

41. What is the difference between a centralized and distributed version control system (VCS)?

Centralized VCS

  • A central server is used to store all file versions
  • No programmer has a copy of files on his local machine 
  • It is a single point of failure if server crashes then all data will be lost
centralized version control system,

Distributed VCS

  • Every programmer/developer has a copy of all project files on his computer 
  • Team members can work offline and there is no single point of failure
  • If the server crashes, there is no need to worry about it. 

42. Do You Know the git command for downloading any repository from GitHub to your computer?

git clone

Yes, we can use “git clone” to download any repository from the GitHub to your local machine. 

43. How can you push a file from your computer to the GitHub repository?

First of all, I will connect my local repository to the remote repository:

git remote add origin [copied web address]      

// Ex: git remote add origin https://github.com/anyexample-address/ver1.git

Secondly, push your file to the remote repository with the help of the following command:

git push origin master

44. Which CLI command is used to rename the files?

git mv command is used for this purpose. 

45. Do you know the difference between Git fetch and Git pull?

Yes, I can differentiate them. Git fetch command is used to download contents from a remote repository and used in conjunction with git branch, git reset, and get remote to update a local repository to the state of a remote. Gil pull is commonly used for pulling new commits from any branch of the central repository to update the target branch. I am repeating my words don’t go for the interview without preparing DevOps questions if you really interested to get a job in a well-reputed organization.

46. Can you enlist the uses of a Version Control System (VCS)? 

Following are the Important uses of a Version Control System:

  • You can check the history and last modifications that caused a problem
  • Developers can compare the changes made over time
  • It is easy to identify who introduced a new issue 
  • It is used to revert the files or complete project to earlier states

47. Is it possible to secure Jenkins?

Of course, we can secure the Jenkins in the following ways:

  • Make sure the global security is ON
  • Check the Jenkins integration 
  • Ensure that the project matrix is enabled
  • Automate the process of setting up rights and privileges
  • By limiting physical access to Jenkins data
  • Apply security audits on a regular basis

48. Can you define the Jenkins Pipeline?

It is a suite of plugins that supports the implementation and integration of continuous delivery pipelines into Jenkins.  

49. Explain the key aspects of the Jenkins pipeline?

  • Pipeline: User-defined model of a continuous delivery pipeline that defines the entire build process, and also includes the building, testing and delivering an application
  • Node: It is a machine that is capable of executing a pipeline
  • Step: It is a particular task that tells Jenkins what to do at any specific time
  • Stage: Distinct subset of tasks performed through the entire pipeline (build, test, deploy stages)

50. Do you know about the Jenkinsfile?

Yes, it is a text file that contains the definition of a Jenkins pipeline and checked into the source control repository. Jenkinsfile allows the review, iteration and also permits an audit trail for the pipeline. Responsible persons can view, edit the single source of truth for the pipeline. 

51. Can you tell the file name that is used to define dependency in Maven?

Pom.xml

52. Which command is used to run the Jenkin? 

java –jar Jenkins.war

53. Is it possible to move or copy Jenkins from one server to another?

move or copy Jenkins from one server to another

Yes, it is possible by copying with the Jenkins jobs directory from the old server to a new server. By performing this action, the installation can be moved from one installation to another.

54. How Can we make a new copy of an existing Jenkins job?

Simply copy the existing Jenkins job by creating a clone of the directory in a different name. 

55. Can You Explain the master-slave architecture of Jenkins?

Jenkins master-slave architecture

Whenever a code commit is made, the Jenkins master pulls the code from the remote GitHub repository and distribute the workload to all the Jenkins slaves. These slaves carry out, builds, test, and produce test reports on the request of Jenkins master. DevOps engineer interview questions and answers are beneficial for beginners as well as experienced professionals. 

56. Explain the two types of pipeline and their syntax.

There are two types of pipelines: Scripted and Declarative. 

Scripted Pipeline is based on a groovy script and one or more node blocks perform the core work throughout the entire pipeline. 

Syntax: 

  1. Executes the pipeline on any available agent
  2. Defines a build stage
  3. Here you can perform steps related to build stage
  4. Defines a test stage
  5. At this stage, perform steps related to the test stage
  6. Defines a deploy stage
  7. Now, performs the steps related to deploy stage
Jenkinsfile Scripted Pipeline

Declarative Pipeline provides a simple syntax to define a pipeline and defines the work done throughout the pipeline. 

Syntax: 

  1. Executes the pipeline (or any stages) on any available agent
  2. Defines a build stage
  3. Declarative pipeline performs steps related to build stage
  4. Defines a test stage
  5. At this stage, performs steps related to the test stage
  6. Defines a deploy stage
  7. Now, performs the steps related to the deploy stage
Jenkinsfile Declarative pipeline

57. How to create a backup and copy files in Jenkins? 

Take the backup of your JENKINS_HOME directory on a regular basis for creating the backup of Jenkins set up that contains the build jobs configurations, slave node configurations, and build history. Moreover, you can also copy a job directory to clone. 

58. Define three security mechanisms Jenkins uses to authenticate users.

  • An internal database is used to store credentials and user data. 
  • LDAP (Lightweight Directory Access Protocol) is used to authenticate the users. 
  • Jenkins uses the authentication mechanism used by the application server.

59. Have you understood how a custom build core plugin deployed?

We have included the DevOps interview questions and answers for experienced in order to deliver you a complete and expert-level knowledge so that you can get a valuable job in a well-reputed organization. 

Yes, we can deploy a custom build core plugin with the following steps: 

  • Copy the .hpi file to the “$JENKINS_HOME/plugins”
  • Now, remove the plugin’s development directory 
  • Then create an empty file named <plugin>.hpi.pinned
  • Finally, restart the Jenkins and your custom build core plugin is available for use. 

60. What are the different ways in which a build can be scheduled/run in Jenkins?

  • With the help of source code management commits
  • Once the other builds are completed then a build can be scheduled or run 
  • Using manual build requests
  • Scheduled to run at a particular time

61. How can you restart Jenkins manually?

There are two ways to restart the Jenkins manually:

(Jenkins_url)/restart            // This command will not wait for the builds to complete                                

(Jenkins_url)/safeRestart    // All running builds will be complete before it restarts  

DevOps Interview Questions for Continuous Testing – Selenium

62. Why is Selenium used?

The main purpose of using Selenium in the DevOps is continuous testing in functional and regression forms. 

63. Why is the Selenium Grid used?

It is used to execute the same or different test scripts on different browsers and platforms so that the distributed test execution can be made. Selenium grid is used to save the execution time and provide the options to test under various environments. 

64. What are the major components of Selenium?

Selenium is an opensource tool used for automating various web applications. It has mainly four major components that are described below: 

1. Selenium IDE

Selenium IDE (Integrated Development Environment) is a framework with easy record and playback function. If the application tester has the basic knowledge of HTML, JavaScript, and DOM then it will be easier to utilize Selenium IDE. 

2. Selenium RC

Selenium RC (Remote Control) is a valuable tool that helps to understand the test scripts and provide support for top programming languages like Ruby, PHP, Java, etc. But keep in mind, it does not support playback and record feature. 

3. Selenium WebDriver

It is the extension of Selenium Remote Control, but it also supports several platforms and all the latest browsers. Mainly, the selenium web driver was created to support vital web pages in which dynamic elements are used and changing their positions without reloading the page, and it calls the browser for automation.

4. Selenium GRID

It is a wonderful tool that runs multiple test cases against different machines and web browsers in parallel. It is used with the selenium remote control.

65. Briefly explain the different exceptions in Selenium WebDriver?

Exceptions are the events that occur during the runtime of the project/program and disrupt the normal execution. Following are the main selenium exceptions: 

  • TimeoutException – It is thrown when a command performing an operation does not complete in a specific time.
  • NoSuchElementException – It is thrown when an element having specific attributes is not found.
  • ElementNotVisibleException – It is thrown when an element is present in DOM (Document Object Model) but not visible. For example: Hidden Elements are defined in HTML using type=“hidden”.
  • SessionNotFoundException – You were running tests and you lose connection with your browser instance then SessionNotFoundException will be thrown. In this exception either you inadvertently quit the driver instance or browser is crashed.

66. Can we test an application on an Android browser with the help of Selenium?

Yes, we can test both applications native apps and web apps on the android browser using Selendroid or Appium framework. 

67. Do You know about the different test types that Selenium supports?

  • Functional – A black-box testing technique in which the test cases are based on the software specification.
  • Regression – This testing method is used to find new errors or regressions in different functional and non-functional areas of code after the change has made.
  • Load Testing – A testing type used to monitor the response of a device after putting a load on it. Load testing is very helpful in order to understand the behavior of the system under certain conditions.

68. Can we access the text of a web element if yes then how?

Yes, we can access the text of any particular web page with the help of Get command that will return a string value. It is used for the verification of messages, labels and errors displayed on the web page. Here is the syntax: 

String Text=driver.findElement(By.id(“text”)).getText();

69. Which one is not a WebElement method?

  • getText()
  • size()
  • getTagName()
  • sendKeys()

size() is not a WebElement method. 

70. What is the purpose of findElement() and findElements()?

findElement() is a method used to match the locator value with the first element in the current webpage. 

WebElement element=driver.findElement(By.xpath(“//div[@id=‘example’]//ul//li”));

findElements() is a method used to find out all the values matched with the locator values.  

WebElement element=driver.findElements(By.xpath(“//div[@id=‘example’]//ul//li”));

71. What are driver.close() and driver.quit() in Selenium WebDriver?

the driver is the WebDriver object and driver.close() command is used to close the browser window which is currently in focus other windows will not be closed.

driver.quit() is used to turn closes all the browser windows and terminates the WebDriver session by calling the driver.dispose method.  

72. How can we submit a form using Selenium?

Using selenium, you can submit a form with the following code. 

WebElement el = driver.findElement(By.id(“ElementID”));

el.submit();

DevOps Interview Questions related to Configuration Management — Chef, Puppet, Ansible

73. Can you explain Why are SSL certificates used in Chef?

We need SSL certificates in order to make sure that each node has access to the right data and a secure connection with Chef server. All nodes connected with this main Chef server have a private and public key. The public key will be stored at the Chef server and whenever the SSL certificate is sent to the server, it will contain the private key of any particular node. 

Now the Chef server will compare and verify the public key before giving access to the required data. Simply, with the help of SSL certificates the server will form an encrypted connection with any node. Nowadays, interview questions for DevOps engineer are compulsory because the job competition is increased in the market. 

74. What is Test Kitchen in Chef and the most commonly used commands for this purpose?

Test kitchen is a command-line tools used to spin up an instance and provide the ability to test the cookbook on it before deploying on production nodes. Following are the most commonly used commands: 

$ kitchen create //create instances

$ kitchen converge //combine multiple instances

$ kitchen verify //verify the instances

$ kitchen destroy // destroy instances

$ kitchen setup //setup instances

75. You want to disable or stop the “httpd” service, which of the following command is correct? 

  1. # systemctl disable httpd.service
  2. # system disable httpd 
  3. # system disable httpd.service
  4. # systemctl disable httpd.service

The correct answer is A. # systemctl disable httpd.service

76. Differentiate both chef-apply and chef-client?

Chef-apply runs on the client system and applies the recipe stated in the following command: 

$ chef-apply recipe_name.rb

Chef-client is also run on the client system and applies all the cookbooks in your server’s run list to the client system having the following command: 

 $ knife chef-client

77. Do you know about the Puppet Module?

Yes, it is a collection of manifests and data (including templates, facts or any other files) that have a particular directory structure. 

78. What is the difference between Puppet Module and Puppet Manifest?

Manifests are the file formats that store the puppet configuration and modules is the name of bundling the manifests and other resources into a reusable package. Puppet manifest uses .pp extension and the puppet programs are based on puppet code. Puppet modules organize different puppet manifests and class definitions into a shareable unit.  

79. What are the major differences between Ansible and Puppet?

DevOps engineer interview questions are specially written to understand all the aspects of the job responsibilities because they also have to manage and control a huge number of hosting servers either they are in San Francisco, or india. Nowadays, there are advanced technologies such a cloud computing and virtualization that are exponentially growing. Ansible and puppet are used to manage a large number of servers and also known as remote execution and configuration management tools. You can never ignore the real importance of these tools because they are also used to execute commands on multiple servers simultaneously. The key purpose of these tools is to maintain and configure thousands of servers together. We can differentiate both based on the following aspects: 

Category

  • Ansible
  • Puppet

Scalability

  • Ansible is simple and convenient
  • Puppet is also scalable but lacks as compared to ansible

Management and Scheduling

  • In the case of Ansible, the configuration is pushed from the server to the nodes for better code employment. 
  • In puppet, the configuration gets pulled from any selected server.

Language

  • Ansible is written in Python and uses YAML syntax to write configurations.
  • Puppet is developed using Ruby and uses declarative language for configurations.

Availability 

  • In case of any nodal failure, there is no need to worry about availability because the subordinate node is present.
  • Multiple master servers are present so that if the current master fails, it does not stop the ongoing tasks. 

Repository

  • Ansible uses Ansible Galaxy to store all the information.
  • Puppet uses the Puppet forge, which has 6000 modules.

80. Can you explain the Puppet in DevOps?

Puppet is a configuration management tool that uses the master-slave architecture and automates the administration tasks. System administrators need to perform different tasks incl uding installation and configuration of servers. These repetitive tasks become hectic when the infrastructure is large. Puppet makes it easier to configure, deploy, and management of severs. The puppet configuration management tool defines the distinct configurations for each host and scale up or down. Moreover, it also provides the option of centralized change will be propagated to all configured machines. 

81. Do you know about any tool to make Puppet more powerful?

The configuration changes are tracked with the help of Jira and another maintenance is done using internal procedures. Version control operations are done with the support of Git and the puppet’s code manager app. 

82. What are the resources used in Puppet?

Resources are a vital part of any configuration management tool because they describe a specific resource that puppet can manage on a system such as networking, users, packaging and so on. There is a resource declaration in a catalog that describes the actions to be taken on any resource. Once the catalog is executed, the node is set to the desired state. 

83. Can You explain a class in Puppet?

In the manifest file, classes are the named blocks that configure different functionalities of any node such as files, packages and services. The classes are executed only when explicitly invoked.

 Class apache (String $version = ‘latest’) {

package{

‘httpd’: ensure => $version,

before => File[‘/etc/httpd.conf’],}

84. Have you listened about Ansible work?

Yes, it is an opensource automation tools that is used in DevOps. 

85. Can You tell us what are the categories of Ansible in DevOps?

Controlling machines and nodes are the categories of ansible in DevOps. 

86. Is it possible to install Ansible on the controlling machines?

Yes, it is possible to install the ansible on the controlling machines by using machine nodes with the help of SSH.   

87. What are the benefits of the Ansible agentless tool? 

The agentless tool does not require any kind of mandatory installations on the remote nodes and it comes with the following benefits: 

  • Application development 
  • Configuration management 
  • Task automation 

88. What is an Ansible role in DevOps?

It is an independent block of tasks, variables, templates and files embedded in a playbook. For example, the following playback will install the tomcat on node1:

  • hosts : node1

roles

– {role: install-tomcat}

89. When should we use ‘{{ }}’?

{{}} is used for variables if there is no conditional statement. 

For example:

      echo “This will print the value of {{foo}}”

      when : foo is defined

The use of brackets make it easier to understand the difference between undefined variables and strings. This will also ensure that ansible does not recognize the line as a dictionary definition. 

90. How to make content reusable/redistributable?

Following are the different ways to make content redistributable or reusable: 

  • Roles are used to managing tasks in a playbook that can be shared via ansible-galaxy. 
  • “include” is used to add another file or submodule to a playbook and make it possible to add a single code into multiple playbooks. 
  • “Import” is the updated version of “include” and used to ensure that file is added only once. It is more suitable when a line is run recursively. 

DevOps Interview Questions on Containerization

91. What is the architecture of Docker?

Docker Architecture
  • The basic architecture of Docker is client-server
  • Client is a service that runs a command and it is translated with the help of REST API and then sent to the Server (Docker Daemon).
  • Once the request is received by the docker daemon, it will interact with the operating system to build docker images and run docker containers. 
  • Docker image is a set of instructions used to create containers. 
  • Docker container is the executable package of the application and its dependencies. 
  • Docker registry is a service used to host and distribute the docker images among users. 

92. What are the major benefits of Docker over virtual machines?

CriteriaVirtual Machine Docker
Memory spaceOccupies a lot of memory spaceDocker containers occupy smaller space
Boot-up timeLong Short 
PerformanceUnstable performance Great performance
ScalingIt is difficult to scale-upIt is scalable or Easy to scale-up
EfficiencyLow-efficiencyHigh-efficiency
PortabilityCompatibility issues Easily portable across different platforms
Space allocationData volumes cannot be sharedData volumes are shared easily and used again across multiple containers

93. How do you share Docker containers with different nodes?

docker swarm,
  • We can share docker containers with the help of a docker swarm on different nodes. 
  • Docker swarm facilitates the developers and IT administrators to create or manage a cluster of swarms within the docker platform. 
  • Swarm has two types of nodes: manager node and worker node. 

94. How to create a Docker swarm with the help of commands?

  • Create a swarm by entering the manager IP with the help of the following command: 

Docker swarm init –advertise-addr <MANAGER-IP>

  • Once the manager node is created, now you will add worker nodes to your swarm. 
  • When the manager node is initialized, a token is created. So, in order to create a worker node, you need to execute the following command (token)

Docker swarm join \ –token SWMTKN-1-49nj1cmql0jkz5s234yi3oex3ngtyz0fb0xx14ie61trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ 192.168.19.100:2377

95. Is it possible to run multiple containers using a single service?

is it possible to run multiple containers using a single service?
  • Yes, you can easily run multiple containers with the help of a single service using Docker compose. 
  • Each container can interact with each other but runs in isolation. 
  • All docker compose files are YAML (human-readable data-serialization language) files. 

96. Why do we need a Docker file?

Why do we need a Docker file?
  • Docker file is used to create docker images 
  • Using docker image, anyone can run the code to create docker containers. 
  • Once the Docker image is built, it is uploaded in a docker registry.
  • Now, users can get the docker image from the docker registry and build a new container whenever they want. 

97. What are the main differences between Docker images and Docker containers?

Docker Images Docker Container
Templates of Docker containersRuntime instances of a Docker image
An image is built using a Docker fileContainers are created using Docker images
Stored in a Docker repository or a Docker hubStored in the Docker daemon
Docker image layer is a read-only filesystemContainer layer is a read-write filesystem

98. How to create a Docker container?

A user has two options either he will build a docker image or pull an existing docker image from docker hub. Now, docker will create a new container MySQL and container layer of the read-write filesystem will also be created on the top of the image layer. 

  • Run this command to create docker container: Docker run -t –i MySQL
  • Now list down the running containers with this command: Docker ps

99. Enlist the differences between a registry and a repository?

RegistryRepository
It is an opensource server-side service used for hosting and distributing Docker imagesIt is a collection of multiple versions of Docker images 
A user can distinguish between Docker images with their tag namesIt is stored in a Docker registry 
Docker also has its own default registry called Docker HubIt has two types: public and private repositories

100. What are the names of different cloud platforms that support Docker?

cloud platforms that support Docker

101. What do you know about the expose and publish commands in Docker?

Expose

  • It is an instruction used in Docker file
  • Expose is used to expose ports within a Docker network
  • It is the documented form of instructions used at the time of building an image and running a container
  • Expose is a Docker command.
  • Example: Expose 8080

Publish

  • It is used in a Docker run command
  • You can use publish outside a Docker environment
  • publish is used to map a host port to a running container port
  • –publish or –p is the command used in Docker
  • Example: docker run –d –p 0.0.0.80:80
Shares
Avatar

David Max

Follow me on

Leave a Comment

We keep your privacy and not published your email in site

Confirm you are not a robot

Shares