Published July 08, 2018 by

Jenkins Interview Questions


What is Jenkins?
Jenkins is an open source tool with plugin built for continuous integration purpose.  The principal functionality of Jenkins is to keep a track of version control system and to initiate and monitor a build system if changes occur. It monitors the whole process and provides reports and notifications to alert.

What is Continuous Integration (CI)?
In software development, when multiple developers or teams are working on different segments of the same web application, we need to perform integration test by integrating all modules.  In order to do that an automated process for each piece of code is performed on a daily bases so that all your code gets tested.

What are the CI Tools?

  • Jenkins
  • TeamCity
  • Travis CI
  • Go CD
  • Bamboo
  • GitLab CI
  • CircleCI
  • Codeship

What is the programming language used to build Jenkins?
Jenkins is an open source automation server written in Java.

What is the requirement for using Jenkins?

  • A source code repository which is accessible, for instance, a Git repository
  • A working build script, e.g., a Maven script, checked into the repository

What are the features of Jenkins?
Continuous Integration and Continuous Delivery - As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.

Easy installation - Jenkins is a self-contained Java-based program, ready to run out-of-the-box, with packages for Windows, Mac OS X, and other Unix-like operating systems.

Easy configuration - Jenkins can be easily set up and configured via its web interface, which includes on-the-fly error checks and built-in help.

Plugins - With hundreds of plugins in the Update Center, Jenkins integrates with practically every tool in the continuous integration and continuous delivery toolchain.

Extensible - Jenkins can be extended via its plugin architecture, providing nearly infinite possibilities for what Jenkins can do.

Distributed - Jenkins can easily distribute work across multiple machines, helping drive builds, tests and deployments across multiple platforms faster.

What are the advantages of Jenkins?

  • At integration stage, build failures are cached
  • For each code commit changes an automatic build report notification generates
  • To notify developers about build report success or failure, it is integrated with LDAP mail server
  • Achieves continuous integration agile development and test-driven development
  • With simple steps, maven release project is automated
  • Easy tracking of bugs at early stage in development environment than production

How you can move or copy Jenkins from one server to another?
Slide a job from one installation of Jenkins to another by copying the related job directory
Make a copy of an already existing job by making a clone of a job directory by a different name. Renaming an existing job by renaming a directory.

Some of the useful plugins in Jenkins?

  • Maven 2 project
  • Amazon EC2
  • HTML publisher
  • Copy artifact
  • Join
  • Green Balls

How you can deploy a custom build of a core plugin?

  • Stop Jenkins
  • Copy the custom HPI to $Jenkins_Home/plugins
  • Delete the previously expanded plugin directory
  • Make an empty file called <plugin>.hpi.pinned
  • Start Jenkins

How can create a backup and copy files in Jenkins?
Jenkins saves all the setting, build artifacts and logs in its home directory, to create a back-up of your Jenkins setup, just copy this directory. You can also copy a job directory to clone or replicate a job or rename the directory.

How you can set up Jenkins job?
To create a project that is handled via jobs in Jenkins.  Select a New item from the menu, once this done to enter a name for the job and select a freestyle job. Then click OK to create a new job in Jenkins.  The next page enables you to configure your job.

What is a Jenkins Pipeline?
Jenkins Pipeline (or simply "Pipeline") is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins.

What is a Continuous delivery pipeline?
A continuous delivery pipeline is an automated expression of your process for getting software from version control right through to your users and customers.

What is Jenkinsfile and what it does?
The definition of a Jenkins Pipeline is typically written into a text file called a Jenkinsfile which in turn is checked into a project’s source control repository.

What is the difference between Poll SCM & Build Periodically in Jenkins?
The primary difference between triggering a build periodically and poll SCM is, with Trigger Builds Periodically will trigger builds as per the schedule (i.e. every 10 minutes) even if you haven't changed anything. Poll SCM will check for changes before triggering any build, if there are changes to the previous version there only build will be triggered.

What are the two components Jenkins is mainly integrated with?

  • Version Control system like GIT, SVN
  • And build tools like Apache Maven.

How will you secure Jenkins?

  • Ensure global security is on.
  • Ensure that Jenkins is integrated with my company’s user directory with the appropriate plugin.
  • Ensure that the matrix/Project matrix is enabled to fine tune access.
  • Automate the process of setting rights/privileges in Jenkins with a custom version controlled script.
  • Limit physical access to Jenkins data/folders.
  • Periodically run security audits on same.

What is the relation between Hudson and Jenkins?
Hudson was the earlier name and version of current Jenkins. After some issue, the project name was changed from Hudson to Jenkins.

What you do when you see a broken build for your project in Jenkins?
I will open the console output for the broken build and try to see if any file changes were missed. If I am unable to find the issue that way, then I will clean and update my local workspace to replicate the problem on my local and try to solve it.

What are the various ways in which build can be scheduled in Jenkins?

  • By source code management commits
  • After completion of other builds
  • Can be scheduled to run at a specified time
  • Manual Build Requests

What is the difference between Maven, Ant, and Jenkins?
Maven and Ant are Build Technologies whereas Jenkins is a continuous integration tool.

Which SCM tools Jenkins supports?

  • Subversion
  • Git
  • Mercurial
  • AccuRev
  • CVS
  • Perforce
  • Clearcase
  • RTC

What is Blue Ocean in Jenkins?
Blue Ocean is a project that rethinks the user experience of Jenkins, modeling and presenting the process of software delivery by surfacing information that’s important to development teams with as few clicks as possible, while still staying true to the extensibility that is core to Jenkins.