Menu ×

Interview Preparation Guide

Most Asked DevOps Interview Questions

Here we have compiled the most probable DevOps interview questions asked in the industry. You will learn about software version control, Git repository, reverting a commit in Git, Vagrant, continuous testing elements, and the importance of continuous integration, testing, and deployment. These questions are curated after discussing with many interviewers and DevOps Training experts.

DevOps Tools

Git
Maven
Jenkins
Docker
Ansible
Terraform
Kubernetes
Interview Questions
Showing 161 - 170 of 325 results
161. Explain how you can exclude dependency?

By Using an Exclusion Element in pom.xml dependencies can be excluded. For example, you have to add this in your project's pom.xml file.
<exclusions>
    <exclusion>
          <groupId>sample.Project</groupId>
          <artifactId>Project</artifactId>
          <version>1.2.3</version>
     </exclusion>
</exclusions>

162. Explain how to run the test classes in Maven?

The surefire plugin is used to run the test classes in Maven & check and configure your settings in setting.xml and pom.xml for a property named 'test'. Here is an example of adding surefire plugin to Pom.xml.

<plugins>
     <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
     </plugin>
</plugins>

And then you have to execute this command
$ mvn test   //for single test
$ mvn -Dtest=UsersServiceImplTest test   //for all tests.

163. List out the build, source and test directory in Maven?

Build directory is your "Target" directory, Source is your "src/main/java" and test is "src/main/test" directory all these will be under "src" directory.

164. What build tool does?

Build tool does the following:

  • Generates artifacts/binaries for the source code will be generated.
  • From source code it generates documentation.
  • Source code will be compiled.
  • Packs compiled code into a JAR, WAR or ZIP File.
  • Copies packed code into the local repository along with their build versions in "com" directory.

165. What is meant by MOJO in Maven?

MOJO (Maven Plain Old Java Object) is the smallest executable unit that maven recognizes. MOJO has its own goal, a plugin has one or more goals to execute as it is a collection of one or more MOJOs. It is the smallest unit of maven plugin. Or the smallest plugin.

166. Where MAV coordinates/GAV Parameters come into picture?

Decide Artifact type and its storage path in local/central/remote repositories. And decides Jar/War names Identify a particular version of JAR file to be downloaded during dependency resolution. And all this GAV parameters are used in POM.xml file.

167. List out the Maven's order of inheritance?

  1. Parent POM or Super POM
  2. Project POM
  3. Settings
  4. CLI Parameters.

168. How do you produce error messages in maven?

There are various commands to produce debug messages, For instance, more popular is -x flag or --debug. There are various commands to produce error messages ,For instance ,more popular is -e flag or --error.

169. What do you Mean by Super POM?

Default POM of Maven is the Parent POM or Super POM. All POMs are derived from super pom.

170. What is a Maven Artifact?

An Artifact is a file, usually it is a JAR/WAR file that gets deployed into a Maven Repository. A Maven build creates one or more artifacts. This file includes all the project.

Contact us
    +91 9 6276 6276 9
    +1 (866)693-2179
Available 24x7 for your queries