Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Gradle Online Test

Topics Covered

  • Gradle Daemon basic concepts
  • Gradle basic concepts
  • Running Gradle commands
  • Running scripts in Gradle
  • Analyzing Duplicities in Gradle Projects
  • Working with plugins in Gradle

Useful for hiring

  • Full Stack Web Developer
  • Android Developer - Gradle
  • Senior Java Developer - Gradle

Start hiring job-fit candidates using this assessment

GET A DEMO

"Finding quality talent is a challenge more so when you consider the sheer number of resumes we get each year. To top this, the time we spent on our recruitment process was humongous. Interview Mocha helped us to cut down on our candidate filtration time by 40%, making it our preferred assessment tool."

Pedro Furtado, Altran,
Capacity Manager
Question

The Java plugin emulates many of Maven's expected lifecycles as tasks in the dependency driven acyclic graph for the inputs and outputs of each task.  For projects that do not follow the Maven conventions, Gradle allows the directory structure to be configured.

Based on this which code snippet would support a project that contains the source files in src/java instead of src/main /?

Answer
    • get plugin: 'java'
      source.set.java.dir = ['src/java']

    • add plugin: ['java']
      java.dir = {'src/java'}

    • apply plugin: 'java'
      sourceSets.main.java.srcDirs = ['src/java']

    • apply plugin: 'java'
      main.java.src = ['src/java']

Question

Which of the following alternatives correctly expresses concepts related to Gradle?

Answer
    • The key to using all the power of Gradle is to get to know your API in depth; we can find all classes and understand everything Gradle already natively gives us to work efficiently and quickly.

    • Due to its definition of dependencies between the project submodules, Gradle takes care of building all project components.

    • One of the major disadvantages of Gradle is that it does not have a local cache to make the dependencies available.

    • Early versions of Gradle were pure XML only. Only from version 3.0 that Gradle was developed in Groovy.

Question

Which code snippet correctly appends Spring dependencies to a Gradle project?

Answer
    • add-dependency ['org.springframework:spring-core:4.1.0.RELEASE']
      add-dependency ['org.springframework:spring-context:4.1.0.RELEASE']

    • get: 'org.springframework:spring-core:4.1.0.RELEASE'
      get: 'org.springframework:spring-context:4.1.0.RELEASE'

    • compile 'org.springframework:spring-core:4.1.0.RELEASE'
      compile 'org.springframework:spring-context:4.1.0.RELEASE'

    • add( 'org.springframework:spring-core:4.1.0.RELEASE')
      add( 'org.springframework:spring-context:4.1.0.RELEASE')

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO