Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Jenkins Interview Questions and Answers – Part 6

Spread the Knowledge

What are the parts of the task lifecycle

  • Execution
  • Initialization, Configuration, Execution (Ans)
  • Initialization, Configuration, Execution, Finalization
  • Configuration, Execution

How do you declare a typed task?

  • task copyImages (type: Copy) (Ans)
  • Copy copyImages
  • task copyImages (Copy)

In a multi project build which two files do I need to add to the top level project?

  • build.gradle and build.settings
  • multi.gradle and settings.gradle
  • build.gradle and settings.gradle (Ans)
  • build.gradle and settings.properties

What does the wrapper task do?

  • Wraps up the code so that any exceptions are caught
  • Wraps gradle so it can be used from an IDE such as Eclipse
  • Installs an extra set of Java tasks to make testing easier
  • Ensures that all developers use the same version of Gradle to build the code (Ans)

What is the syntax for filtering tests in gradle?

  • add a test { filter {} } closure (Ans)
  • build only the tests you want to run
  • you have to run all the tests, you cannot filter
  • add the test-filter plugin

What does taskA.finalizedBy taskB do?

  • Causes taskB to run before taskA
  • Nothing, this is not yet available in Gradle
  • Causes taskB to run after taskA (Ans)
  • Causes taskA and taskB to run in parallel

How do you declare a task?

  • Task taskName (Ans)
  • Task.withName taskName
  • taskName: Task
  • Task: taskName

When copying files you can use which method to replace text?

  • expand (Ans)
  • replace
  • insert
  • regex

How do you declare dependencies between tasks?

  • taskA : taskB
  • taskB.runsBefore taskA
  • taskA.depends taskB
  • taskA.dependsOn taskB (Ans)

Which of the following is valid gradle syntax to add a compile dependency on junit?

  • compile name=junit version=4.1.2
  • compile ‘junit:junit:4.1.12’ (Ans)
  • compile ‘junit:4.12’
  • compile ‘junit:version:4.1.12’

What is the syntax for defining a repository in Gradle?

  • use jcenter()
  • repositories { jcenter() } (Ans)
  • repository: jcenter()
  • repositories: jcenter()

When you call doLast on a task twice passing different closures what happens?

  • Only the first closure is executed
  • Neither closure is executed, it is an error
  • Only the last closure is executed
  • Both closures are executed (Ans)

How do you add the java plugin?

  • apply java plugin
  • apply plugin ‘java’ (Ans)
  • java ‘plugin’
  • Do nothing. The plugin is always enabled

If you use the gradle-testsets-plugin how do you add an integrationTest sourceset in gradle?

  • testSets { integrationTest = ‘myDir’ }
  • integrationTest { dirName=’myDir’}
  • testSets { integrationTest { dirName=’myDir’ } } (Ans)
  • testSets { dirName=’myDir’}

When you use the << syntax which method on the task is executed?

  • last
  • first
  • doFirst
  • doLast (Ans)

When you taskA.mustRunAfter taskB

  • taskB always runs after
  • taskA always runs after taskB
  • taskA runs after taskB only if both tasks are scheduled to run (Ans)

If I want to run a java application which plugin do I use?

  • java-runner
  • java
  • run
  • application (Ans)
Rajesh Kumar