DevOps Interview Questions and Answers
Question - 51 : - Explain how you can move or copy Jenkins from one server to another?
Answer - 51 : -
- Move a job from one installation of Jenkins to another by simply copying the corresponding job directory.
- Make a copy of an existing job by making a clone of a job directory by a different name.
- Rename an existing job by renaming a directory. Note that if you change a job name you will need to change any other job that tries to call the renamed job.
Question - 52 : - What is Jenkinsfile?
Answer - 52 : -
Jenkinsfile contains the definition of a Jenkins pipeline and is checked into the source control repository. It is a text file.
- It allows code review and iteration on the pipeline.
- It permits an audit trail for the pipeline.
- There is a single source of truth for the pipeline, which can be viewed and edited.
Question - 53 : - Which of the following commands runs Jenkins from the command line?
Answer - 53 : -
- java –jar Jenkins.war
- java –war Jenkins.jar
- java –jar Jenkins.jar
- java –war Jenkins.war
The correct answer is A) java –jar Jenkins.war
Question - 54 : - What concepts are key aspects of the Jenkins pipeline?
Answer - 54 : -
- Pipeline: User-defined model of a CD pipeline. The pipeline's code defines the entire build process, which includes building, testing and delivering an application
- Node: A machine that is part of the Jenkins environment and capable of executing a pipeline
- Step: A single task that tells Jenkins what to do at a particular point in time
- Stage: Defines a conceptually distinct subset of tasks performed through the entire pipeline (build, test, deploy stages)
Question - 55 : - Name three security mechanisms Jenkins uses to authenticate users.
Answer - 55 : -
- Jenkins uses an internal database to store user data and credentials.
- Jenkins can use the Lightweight Directory Access Protocol (LDAP) server to authenticate users.
- Jenkins can be configured to employ the authentication mechanism that the deployed application server uses.
Question - 56 : - How is a custom build of a core plugin deployed?
Answer - 56 : -
Steps to deploy a custom build of a core plugin:
- Copy the .hpi file to $JENKINS_HOME/plugins
- Remove the plugin's development directory
- Create an empty file called .hpi.pinned
- Restart Jenkins and use your custom build of a core plugin
Question - 57 : - What are the ways in which a build can be scheduled/run in Jenkins?
Answer - 57 : -
- By source code management commits.
- After completion of other builds.
- Scheduled to run at a specified time.
- Manual build requests.
Question - 58 : - What are the commands that you can use to restart Jenkins manually?
Answer - 58 : -
Two ways to manually restart Jenkins:
(Jenkins_url)/restart // Forces a restart without waiting for builds to complete
(Jenkins_url)/safeRestart // Allows all running builds to complete before it restarts
Question - 59 : - What are the different exceptions in Selenium WebDriver?
Answer - 59 : -
Exceptions are events that occur during the execution of a program and disrupt the normal flow of a program's instructions. Selenium has the following exceptions:
- TimeoutException - It is thrown when a command performing an operation does not complete in the stipulated time.
- NoSuchElementException - It is thrown when an element with specific attributes is not found on the web page.
- ElementNotVisibleException - It is thrown when an element is present in Document Object Model (DOM) but is not visible. Ex: Hidden Elements defined in HTML using type=“hidden”.
- SessionNotFoundException - The WebDriver is performing the action immediately after quitting the browser.
Question - 60 : - What are the different test types that Selenium supports?
Answer - 60 : -
Functional - This is a type of black-box testing in which the test cases are based on the software specification.
Regression - This testing helps to find new errors, regressions, etc. in different functional and non-functional areas of code after the alteration.
Load Testing - This testing seeks to monitor the response of a device after putting a load on it. It is carried out to study the behavior of the system under certain conditions.