100+ DevOps Interview Questions You Must Prepare To Get Job

26 min read

DevOps stands for Development and Operations is a well-renowned software development practice that most organizations adopt into their workflow. According to Forrester (a top research firm), more than 50% of the organization has implemented and expanding whereas 27% are planning to implement shortly. Biggest enterprises such as Google, Facebook, Amazon, and Netflix have implemented and opened 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, that you can’t get a job without preparing DevOps questions.

Jobs related to DevOps become the most promising career choices for professionals. But keep in mind organizations are enhancing their output by hiring only applicants who have in-depth knowledge, skills, and certifications. So, this article aims to help those candidates boost their knowledge with several questions asked by industry experts. 

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

Table of Contents

DevOps Interview Questions and Answers 

DevOps Interview Questions Related To Basic Introduction

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

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 facilitates 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 of thousands of deployments in a single day with security, stability, and reliability. 

2. Can you provide an overview of DevOps phases?

Can you provide an overview of DevOps phases

There are 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 which 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 publish in a service that integrates with the 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 provide opportunities for scalability, availability, and transformation. 

Monitor

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 organizations expand their businesses and earn an attractive amount of income. When most of the companies started to adopt this methodology it became 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 shortly. 

Programmers and developers can develop applications within a record period having higher efficiency. Nowadays, most 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 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 DevOps and Agile with the help of a diagram. 

What are the Key differences between DevOps & Agile

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 conflicts and gaps between the customers and developers. If we talk about 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, 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 provides 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 relies on the feedback from customers.

Scope of Work: For DevOps, the scope of work is agility and the 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?

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

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

8. What is 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 the compilation succeeds. 

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

When the traditional development lifecycle is 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 are 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.

The 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 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 anything went wrong. The main purpose of these meetings is to finalize actions or planning to avoid the same errors. 

16. Can you differentiate Asset Management and Configuration Management?

Asset management is the process of monitoring and maintaining valuable things in 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 of enhancing 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? 

How can you maintain the entire architecture using 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 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 whether all applications are running correctly or not. Moreover, it also enables 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 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 arrive 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, storage, 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 a data breach, its 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 (Dev) software development and (Ops) IT operations to provide continuous delivery and a higher level of quality. Both operation engineers and the 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 in 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 create test scripts that can be executed again and again automatically. In contrast, 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 Delivery Continuous 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 expected Makes 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

Git – DevOps Interview Questions related to Source Code Management

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 the following steps:

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

33. Do You Know About Forking Workflow?

Forking workflow is different from other workflows because it gives every developer their 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?

Can You Define Git stash

Consider a scenario, where 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 
What is branching in Git

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 in the picture given below:  

Git Rebase

Git Merge:

Whenever the programmers want to add new commits to 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? 

The following are the key benefits of a 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 them 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 undo 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 a server crashes then all data will be lost
Centralized VCS

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?

GitHub

Yes, we can use “git clone” to download any repository from 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. The git fetch command is used to download contents from a remote repository and used in conjunction with the 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 are interested in getting a job in a well-reputed organization.

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

The 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 regularly

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 is checked into the source control repository. Jenkinsfile allows the review, and iteration and also permits an audit trail for the pipeline. Responsible persons can view, and edit the single source of truth for the pipeline. 

51. Can you tell me 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?

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

Yes, it is possible to copy 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 with a different name. 

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

Can You Explain the master-slave architecture of Jenkins

Whenever a code commit is made, the Jenkins master pulls the code from the remote GitHub repository and distributes the workload to all the Jenkins slaves. These slaves carry out, build, test, and produce test reports at the request of Jenkins’s 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 the building stage
  4. Defines a test stage
  5. At this stage, perform steps related to the test stage
  6. Defines a deployment stage
  7. Now, perform the steps related to the deployment 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 the build stage
  4. Defines a test stage
  5. At this stage, performs steps related to the test stage
  6. Defines a deployment stage
  7. Now, perform the steps related to the deployment stage
Jenkinsfile Declarative pipeline

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

Take the backup of your JENKINS_HOME directory regularly for creating the backup of the Jenkins setup 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-built core plugin is deployed?

We have included the DevOps interview questions and answers for experienced to deliver you 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 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  

Selenium – DevOps Interview Questions for Continuous Testing

62. Why is Selenium used?

The main purpose of using Selenium in 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 open-source tool used for automating various web applications. It has four major components that are described below: 

1. Selenium IDE

Selenium IDE (Integrated Development Environment) is a framework with easy recording and playback functions. 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 provides support for top programming languages like Ruby, PHP, Java, etc. But keep in mind, that it does not support playback and recording features. 

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. The following are the main selenium exceptions: 

  • TimeoutException – It is thrown when a command operating 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 – If you were running tests and you lost connection with your browser instance then SessionNotFoundException will be thrown. In this exception either you inadvertently quit the driver instance or the browser crashes.

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 been 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 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 the Get command which 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 close all the browser windows and terminate 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();

Configuration Management – DevOps Interview Questions

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

We need SSL certificates to make sure that each node has access to the right data and a secure connection with the Chef server. All nodes connected with this main Chef server have a private and public key. The public key will be stored on 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 engineers are compulsory because the job competition is increasing 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 tool used to spin up an instance and provide the ability to test the cookbook on it before deploying it on production nodes. The 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 commands 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 are 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 whether they are in San Francisco or India. Nowadays, there are advanced technologies such as cloud computing and virtualization that are exponentially growing. Ansible and Puppet are used to manage a large number of servers and are 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 including installation and configuration of servers. These repetitive tasks become hectic when the infrastructure is large. Puppet makes it easier to configure, deploy, and manage servers. The puppet configuration management tool defines the distinct configurations for each host and scales 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 other maintenance is done using internal procedures. Version control operations are done with the support of Git and 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 to Ansible’s work?

Yes, it is an open-source automation tool 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 makes 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 manage 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 is used to ensure that the file is added only once. It is more suitable when a line is run recursively. 

Containerization – DevOps Interview Questions

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. 
  • A docker image is a set of instructions used to create containers. 
  • A 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?

Criteria Virtual Machine  Docker
Memory space Occupies a lot of memory space Docker containers occupy smaller space
Boot-up time Long  Short 
Performance Unstable performance  Great performance
Scaling It is difficult to scale up It is scalable or Easy to scale up
Efficiency Low-efficiency High-efficiency
Portability Compatibility issues  Easily portable across different platforms
Space allocation Data volumes cannot be shared Data 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, you will add worker nodes to your swarm. 
  • When the manager node is initialized, a token is created. So, 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?
  • A docker file is used to create docker images 
  • Using a docker image, anyone can run the code to create docker containers. 
  • Once the Docker image is built, it is uploaded to 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 containers Runtime instances of a Docker image
An image is built using a Docker file Containers are created using Docker images
Stored in a Docker repository or a Docker hub Stored in the Docker daemon
Docker image layer is a read-only filesystem The container 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 the docker hub. Now, docker will create a new container MySQL, and the container layer of the read-write filesystem will also be created on the top of the image layer. 

  • Run this command to create a 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.

Registry Repository
It is an opensource server-side service used for hosting and distributing Docker images It is a collection of multiple versions of Docker images 
A user can distinguish between Docker images with their tag names It is stored in a Docker registry 
Docker also has its default registry called Docker Hub It 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 the 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

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Make Your Website Live Today

Choose one of your required Web Hosting Plan at market competitive prices

Temok IT Services
© Copyright TEMOK 2024. All Rights Reserved.