Automation QA Testing Course Content

Java Interview questions

 ClassNotFoundException is an exception that occurs when you try to load a class at run time using Class.forName() or loadClass() methods and mentioned classes are not found in the classpath.

NoClassDefFoundError is an error that occurs when a particular class is present at compile time, but was missing at run time.

For example, the below program will throw ClassNotFoundException if the mentioned class “oracle.jdbc.driver.OracleDriver” is not found in the classpath.

If you run the above program without updating the classpath with required JAR files, you will get an exception akin to:


NoClassDefFoundError

NoClassDefFoundError is an error that is thrown when the Java Runtime System tries to load the definition of a class, and that class definition is no longer available. The required class definition was present at compile time, but it was missing at runtime. For example, compile the program below.

When you compile the above program, two .class files will be generated. One is A.class and another one is B.class. If you remove the A.class file and run the B.class file, Java Runtime System will throw NoClassDefFoundError like below:


Recap

ClassNotFoundException

NoClassDefFoundError

It is an exception. It is of type java.lang.Exception.

It is an error. It is of type java.lang.Error.

It occurs when an application tries to load a class at run time which is not updated in the classpath.

It occurs when java runtime system doesn’t find a class definition, which is present at compile time, but missing at run time.

It is thrown by the application itself. It is thrown by the methods like Class.forName(), loadClass() and findSystemClass().

It is thrown by the Java Runtime System.

It occurs when classpath is not updated with required JAR files.

It occurs when required class definition is missing at runtime.

JAVA TRICKY INTERVIEW QUESTIONS?

1)Can we define an abstract class with no abstract methods in Java?
Ans)yes, you can declare abstract class without defining an abstract method in it. Once you declare a class abstract it indicates that the class is incomplete and, you cannot instantiate it.

2)Can we define a parameterized constructor in an abstract class in Java?

Ans)Yes, we can define a parameterized constructor in an abstract class.

Conditions for defining a parameterized constructor in an abstract class

  • We need to make sure that the class which is extending an abstract class have a constructor and it can call the superclass parameterized constructor.
  • We can call the superclass parameterized constructor in a subclass by using super() call.
  • If we are not placing super() call in the subclass constructor, a compile-time error will occur.
3)Can we create an object of an abstract class in Java?
Ans)No, we can't create an object of an abstract class. But we can create a reference variable of an abstract class. The reference variable is used to refer to the objects of derived classes (subclasses of abstract class).
If you try to instantiate an abstract class a compile time error is generated saying “class_name is abstract; cannot be instantiated”.

4)Can we declare an abstract method final or static in java?
Ans)A method which does not have body is known as abstract method. It contains only method signature with a semi colon and, an abstract keyword before it.
public abstract myMethod();

To use an abstract method, you need to inherit it by extending its class and provide implementation to it.

Declaring abstract method static

If you declare a method in a class abstract to use it, you must override this method in the subclass. But, overriding is not possible with static methods. Therefore, an abstract method cannot be static.

If you still, try to declare an abstract method static a compile time error is generated saying “illegal combination of modifiers − abstract and static”.

Declaring abstract method final

Similarly, you cannot override final methods in Java.
But, in-case of abstract, you must override an abstract method to use it.
Therefore, you cannot use abstract and final together before a method.

If, you still try to declare an abstract method final a compile time error is generated saying “illegal combination of modifiers: abstract and final”.

5)Can we declare an interface with in another interface in java?

Ans)Yes we can define

Nested interfaces

Java allows declaring interfaces within another interface, these are known as nested interfaces.

While implementing you need to refer to the nested interface as outerInterface.nestedInterface.


interface Cars4U_Services {
   interface CarRentalServices {
      public abstract void lendCar();
      public abstract void collectCar();
   }
   interface CarSales{
      public abstract void buyOldCars();
      public abstract void sellOldCars();
   }
}
public class Cars4U implements Cars4U_Services.CarRentalServices,
Cars4U_Services.CarSales {
   public void buyOldCars() {
      System.out.println("We will buy old cars");
   }
   public void sellOldCars() {
      System.out.println("We will sell old cars");
   }
   public void lendCar() {
      System.out.println("We will lend cars for rent");
   }
   public void collectCar() {
      System.out.println("Collect issued cars");
   }
   public static void main(String args[]){
      Cars4U obj = new Cars4U();
      obj.buyOldCars();
      obj.sellOldCars();
      obj.lendCar();
   }
}

Output

We will buy old cars
We will sell old cars
We will lend cars for rent

6)Can we declare constructor as final in java?
Ans)No, 

declaring constructor as final

In inheritance whenever you extend a class. The child class inherits all the members of the superclass except the constructors.

In other words, constructors cannot be inherited in Java, therefore, you cannot override constructors.

So, writing final before constructors make no sense. Therefore, java does not allow final keyword before a constructor.

If you try, make a constructor final a compile-time error will be generated saying “modifier final not allowed here”

7)Can we synchronize abstract methods in Java?

Ans)Synchronization − If a process has multiple threads running independently at the same time (multi-threading) and if all of them trying to access the same resource an issue occurs.

To resolve this, Java provides synchronized blocks/ synchronized methods. If you define a resource (variable/object/array) inside a synchronized block or a synchronized method, if one thread is using/accessing it, other threads are not allowed to access.

synchronized (Lock1) {
   System.out.println("Thread 1: Holding lock 1...");
}

Synchronizing abstract methods

No, you can’t synchronize abstract methods in Java. When you synchronize a method that implies that you are synchronizing the code in it, i.e. when one thread is accessing the code of a synchronized method no other thread is allowed to access it. So synchronizing abstract methods doesn’t make sense, if you still try to do so a compile-time error will be generated.

8)Can we declare an abstract method, private, protected, public or default in java?

Ans)

Declaring an abstract method private

If a method of a class is private, you cannot access it outside the current class, not even from the child classes of it.

But, incase of an abstract method, you cannot use it from the same class, you need to override it from subclass and use.

Therefore, the abstract method cannot be private.

If, you still try to declare an abstract method final a compile time error is generated saying “illegal combination of modifiers − abstract and private”.

Declaring an abstract method protected

Yes, you can declare an abstract method protected. If you do so you can access it from the classes in the same package or from its subclasses.

(Any you must to override an abstract method from the subclass and invoke it.)

9)Can abstract method declaration include throws clause in java?

Ans)Yes, you can throw and exception from an abstract class.

10)If a method in parent class “throws Exception”, can we remove it in overridden method in java?

Ans)While a superclass method throws an exception while overriding it you need to follow the certain rules.

  • The sub class method Should throw Same exception or, sub type −
  • It should not throw an exception of super type −
  • You may leave the method in sub class Without throwing any exception

According to the 3rd rule, if the super-class method throws certain exception, you can override it without throwing any exception.

Example

In the following example the sampleMethod() method of the super-class throws FileNotFoundException exception and, the sampleMethod() method does not throw any exception at all. Still this program gets compiled and executed without any errors.

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
abstract class Super{
   public void sampleMethod()throws FileNotFoundException{
      System.out.println("Method of superclass");
   }
}
public class ExceptionsExample extends Super{
   public void sampleMethod() {
      System.out.println("Method of Subclass");
   }
   public static void main(String args[]) {
      ExceptionsExample obj = new ExceptionsExample();
      obj.sampleMethod();
   }
}

Output

Method of Subclass

11)Can a class in Java be both final and abstract?
Ans)An abstract cannot be instantiated. Therefore to use an abstract class you need to create another class and extend the abstract class and use it.

If a class is final you can’t extend it further.

So, you cannot declare a class both final and abstract

12)Can we override default methods in Java?

Ans)An interface in Java is similar to class but, it contains only abstract methods and fields which are final and static.

Since Java8 static methods and default methods are introduced in interfaces. Unlike other abstract methods these are the methods can have a default implementation. If you have default method in an interface, it is not mandatory to override (provide body) it in the classes that are already implementing this interface.

In short, you can access the default methods of an interface using the objects of the implementing classes.


13)How to write/declare an interface inside a class in Java?

Ans)

Nested interfaces

Java allows writing/declaring interfaces within another interface or, within a class these are known as nested interfaces.

Example

In the following Java example, we have a class with name Sample which contains a nested interface named myInterface.

In the class Sample we are defining a nested class named InnerClass and implementing the nested interface.

 Live Demo

public class Sample {
   interface myInterface{
      void demo();
   }
   class InnerClass implements myInterface{
      public void demo(){
         System.out.println("Welcome to Ramesh Tutorials blog");
      }
   }
   public static void main(String args[]){
      InnerClass obj = new Sample().new InnerClass();
      obj.demo();
   }
}

Output

Welcome to Ramesh Tutorials blog

You can also implement the nested interface using class name as −

Example

 Live Demo

class Test {
   interface myInterface{
      void demo();
   }
}
public class Sample implements Test.myInterface{
   public void demo(){
      System.out.println("Hello welcome to Ramesh qa automation blog ");
   }
   public static void main(String args[]){
      Sample obj = new Sample();
      obj.demo();
   }
}

Output

Hello welcome to  Ramesh qa automation blog

13)Can we declare an interface as final in java?
Ans)If you make an interface final, you cannot implement its methods which defies the very purpose of the interfaces. Therefore, you cannot make an interface final in Java. Still if you try to do so, a compile time exception is generated saying “illegal combination of modifiers − interface and final”.

14)Can we declare a constructor as private in Java?
Ans)Yes, we can declare a constructor as private. If we declare a constructor as private we are not able to create an object of a class. We can use this private constructor in the Singleton Design Pattern.

Conditions for Private Constructor

  • A private constructor does not allow a class to be subclassed.
  • A private constructor does not allow to create an object outside the class.
  • If all the constant methods are there in our class we can use a private constructor.
  • If all the methods are static then we can use a private constructor.
  • If we try to extend a class which is having private constructor compile time error will occur
15)Can we declare a main method as private in Java?
Ans)Yes, we can declare the main method as private in Java.

It compiles successfully without any errors but at the runtime, it says that the main method is not public.

Example:

class PrivateMainMethod {
   private static void main(String args[]){
       System.out.println("Welcome to Ramesh qa automation platfomr blog ");
    }
}

The above code is working successfully at compile time but it will throw an error at the runtime.

Output:

Error: Main method not found in class PrivateMainMethod, please define the main
method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

16)Can We declare main() method as Non-Static in java?
Ans)The public static void main(String ar[]) method is the entry point of the execution in Java. When we run a .class file JVM searches for the main method and executes the contents of it line by line.

You can write the main method in your program without the static modifier, the program gets compiled without compilation errors. 

But, at the time of execution JVM does not consider this new method (without static) as the entry point of the program.  It searches for the main method which is public, static, with return type void, and a String array as an argument.

public static int main(String[] args){
}

If such a method is not found, a run time error is generated.

Example

In the following Java program in the class Sample, we have a main method which is public, returns nothing (void), and accepts a String array as an argument. But, not static.

 Live Demo

import java.util.Scanner;
public class Sample{
   public void main(String[] args){
      System.out.println("This is a sample program");
   }
}

Output

On executing, this program generates the following error −

Error: Main method is not static in class Sample, please define the main method as − public static void main(String[] args)

17)Can we declare the main () method as final in Java?
Ans)Yes, we can declare the main () method as final in Java. The compiler does not throw any error.
  • If we declare any method as final by placing the final keyword then that method becomes the final method.
  • The main use of the final method in Java is they are not overridden.
  • We can not override final methods in subclasses.
  • If we are using inheritance and we need some methods not to overridden in subclasses then we need to make it final so that those methods can't be overridden by subclasses.
  • We can access final methods in the subclass but we can not override final methods.

Example

class BaseClass {
   public final void show(Object o) {
      System.out.println("BaseClass method");
   }
}
class DerivedClass extends BaseClass {
   public void show(Integer i) {
      System.out.println("DerivedClass method");
   }
}
public class Test {
   public static final void main(String[] args) { // declaring main () method with final keyword.
      BaseClass b = new BaseClass();
      DerivedClass d = new DerivedClass();
      b.show(new Integer(0));
      d.show(new Integer(0));
   }
}

Output

BaseClass method
DerivedClass method

18)Can we declare the method of an Interface final in java?

Ans)you cannot declare the method of an interface final.

19)Can we declare final variables without initialization in java?
Ans)

Declaring final variable without initialization

If you declare a final variable later on you cannot modify or, assign values to it. Moreover, like instance variables, final variables will not be initialized with default values.

Therefore, it is mandatory to initialize final variables once you declare them.

Still, if you try to declare final variables without initialization that will generate a compilation error saying "variable variable_name not initialized in the default constructor"

Example

In the following Java program, the class Student contains two final variables name and age and they have not been initialized.

 Live Demo

public class Student {
   public final String name;
   public final int age;
   public void display(){
      System.out.println("Name of the Student: "+this.name);
      System.out.println("Age of the Student: "+this.age);
   }
   public static void main(String args[]) {
      new Student().display();
   }
}

Compile time error

On compiling, this program generates the following error.

Output

Student.java:3: error: variable name not initialized in the default constructor
private final String name;
^
Student.java:4: error: variable age not initialized in the default constructor
private final int age;
^
2 errors

To resolve this, you need to initialize the declared final variables as −

Example

 Live Demo

public class Student {
   public final String name;
   public final int age;
   public Student(){
      this.name = "Raju";
         this.age = 20;
   }
   public void display(){
      System.out.println("Name of the Student: "+this.name );
      System.out.println("Age of the Student: "+this.age );
   }
   public static void main(String args[]) {
      new Student().display();
   }
}

Output

Name of the Student: Raju
Age of the Student: 20


20)Can we declare the variables of a Java interface private and protected?
Ans)

Private fields of an interface

If the fields of the interface are private, you cannot access them in the implementing class.

If you try to declare the fields of an interface private, a compile time error is generated saying “modifier private not allowed here”.

Example

In the following Java example, we are trying to declare the field and method of an interface private.

public interface MyInterface{
   private static final int num = 10;
   private abstract void demo();
}

Compile time error

On compiling, the above program generates the following error

Output

MyInterface.java:2: error: modifier private not allowed here
   private static final int num = 10;
                          ^
MyInterface.java:3: error: modifier private not allowed here
   private abstract void demo();
^
2 errors

Protected fields of an interface

In general, the protected fields can be accessed in the same class or, the class inheriting it. But, we do not inherit an interface we will implement it.

Therefore, cannot declare the fields of an interface protected. If you try to do so, a compile time error is generated saying “modifier protected not allowed here”.

Example

In the following Java example, we are trying to declare the field and method of an interface protected.

public interface MyInterface{
   protected static final int num = 10;
   protected abstract void demo();
}

Output

MyInterface.java:2: error: modifier protected not allowed here
   protected static final int num = 10;
^
MyInterface.java:3: error: modifier protected not allowed here
   protected abstract void demo();

21)Why do we need private methods in an interface in Java 9?
Ans)An interface supports default methods since Java 8 version. Sometimes these default methods may contain a code that can be common in multiple methods. In those situations, we can write another default method and make code reusability. When the common code is confidential then it's not advisable to keep them in default methods because all the classes that implement that interface can access all default methods.

An interface can have private methods since Java 9 version. These methods are visible only inside the class/interface, so it's recommended to use private methods for confidential code. That's the reason behind the addition of private methods in interfaces.

In an interface, there is a possibility of writing common code on more than one default method that leads to code duplication. The introduction of private methods avoids this code duplication.

Advantages of private methods in an interface

  • Avoiding code duplication.
  • Ensuring code re-usability.
  • Improving code readability.

Syntax

private void methodName() {
   // some statementscode
}

Example

interface Operation {
   default void addition() {
      System.out.println("default method addition");
   }
   default void multiply() {
      division();
      System.out.println("default method multiply");
   }
   private void division() {         // private method
      System.out.println("private method division");
   }
}

class PrivateMethodTest implements Operation {
   public static void main(String args[]) {
      PrivateMethodTest test = new PrivateMethodTest();
      test.multiply();
   }
}

Output

private method division
default method multiply


22)Can we initialize blank final variable in Java

Ans)Yes! You can initialize a blank final variable in constructor or instance initialization block.

23)What is blank final variable? What are Static blank final variables in Java?
Ans)

Static variables − Static variables are also known as class variables. You can declare a variable static using the keyword. Once you declare a variable static there would only be one copy of it in the class, regardless of how many objects are created from it.

public static int num = 39;

Instance variables − These variables belong to the instances (objects) of a class. These are declared within a class but outside methods. These are initialized when the class is instantiated. They can be accessed from any method, constructor or blocks of that particular class.

You must access instance variables using an object. i.e. to access an instance variable you need to create an object of the class and using this object you need to access these variables.

final − Once you declare a variable final you cannot reassign value to it.

Blank variables

A final variable which is left without initialization is known as blank final variable. Like instance variables, final variables will not be initialized with default values. Therefore, it is mandatory to initialize final variables once you declare them.

Still, if you try to use blank variables in your code, a compile time error will be generated.

Example

In the following Java program, the class Student contains two final variables name and age and they have not been initialized.

public class Student {
   public final String name;
   public final int age;
   public void display(){
      System.out.println("Name of the Student: "+this.name);
      System.out.println("Age of the Student: "+this.age);
   }
   public static void main(String args[]) {
      new Student().display();
   }
}

Compile time error

On compiling, this program generates the following error.

Student.java:3: error: variable name not initialized in the default constructor
   private final String name;
                        ^
Student.java:4: error: variable age not initialized in the default constructor
   private final int age;
                     ^
2 errors

Solution

To resolve this, you need to initialize the declared final variables as −

public class Student {
   public final String name;
   public final int age;
   public Student(){
      this.name = "Raju";
      this.age = 20;
   }
   public void display(){
      System.out.println("Name of the Student: "+this.name );
      System.out.println("Age of the Student: "+this.age );
   }
   public static void main(String args[]) {
      new Student().display();
   }
}

Output

Name of the Student: Raju
Age of the Student: 20

Static blank final variable

In the same way if you declare a static variable final without initializing it, it is considered as static final variable.

When a variable is declared both static and final you can initialize it only in a static block, if you try to initialize it elsewhere, the compiler assumes that you are trying to reassign value to it and generates a compile time error −

Example

class Data{
   static final int num;
   Data(int i){
      num = i;
   }
}
public class ConstantsExample {
   public static void main(String args[]) {
      System.out.println("value of the constant: "+Data.num);
   }
}

Compile time error

ConstantsExample.java:4: error: cannot assign a value to final variable num
   num = i;
   ^
1 error

Example

Therefore, it’s a must to initialize a static final variable in a static block.

To make the above program work you need to initialize the final static variable in a static block as −

class Data{
   static final int num;
   static{
      num = 1000;
   }
}
public class ConstantsExample {
   public static void main(String args[]) {
      System.out.println("value of the constant: "+Data.num);
   }
}

Output

value of the constant: 1000

24)Can we declare a try catch block within another try catch block in Java?
ANs)Yes, we can declare a try-catch block within another try-catch block, this is called nested try-catch block

25)Can we have a try block without a catch block in Java?
Ans)Yes, It is possible to have a try block without a catch block by using a final block.

As we know, a final block will always execute even there is an exception occurred in a try block, except System.exit() it will execute always.

Example 1

public class TryBlockWithoutCatch {
   public static void main(String[] args) {
      try {
         System.out.println("Try Block");
      } finally {
         System.out.println("Finally Block");
      }
   }
}

Output

Try Block
Finally Block

A final block will always execute even though the method has a return type and try block returns some value.

Example 2

public class TryWithFinally {
   public static int method() {
      try {
         System.out.println("Try Block with return type");
         return 10;
      } finally {
         System.out.println("Finally Block always execute");
      }
   }
   public static void main(String[] args) {
      System.out.println(method());
   }
}

Output

Try Block with return type
Finally Block always execute
10

26)Can a try block have multiple catch blocks in Java?
Ans)Yes, you can have multiple catch blocks for a single try block.

27)Is it possible to have multiple try blocks with only one catch block in java?
Ans)

Multiple try blocks:

You cannot have multiple try blocks with a single catch block. Each try block must be followed by catch or finally. Still if you try to have single catch block for multiple try blocks a compile time error is generated.

Example

The following Java program tries to employ single catch block for multiple try blocks.

class ExceptionExample{
   public static void main(String args[]) {
      int a,b;
      try {
         a=Integer.parseInt(args[0]);
         b=Integer.parseInt(args[1]);
      }
      try {
         int c=a/b;
         System.out.println(c);
      }catch(Exception ex) {
         System.out.println("Please pass the args while running the program");
      }
   }
}

Compile time exception

ExceptionExample.java:4: error: 'try' without 'catch', 'finally' or resource declarations
   try {
   ^
1 error

28)Is it possible to catch multiple Java exceptions in single catch block?
Ans)Yes

In this, you need to specify all the exception classes to be handled separated by “ | ” as shown below −

catch(ArrayIndexOutOfBoundsException | ArithmeticException exp) {
   System.out.println("Warning: Enter inputs as per instructions ");
}

29)Can we have an empty catch block in Java?
Ans)Yes, we can have an empty catch block. But this is a bad practice to implement in Java

30)Can we have a return statement in the catch or, finally blocks in Java?

Ans)Yes, we can write a return statement of the method in catch and finally block.
  • There is a situation where a method will have a return type and we can return some value at any part of the method based on the conditions.
  • If we return a value in the catch block and we can return a value at the end of the method, the code will execute successfully.
  • If we return a value in the catch block and we can write a statement at the end of the method after return a value, the code will not execute so it became unreachable code as we know Java does not support unreachable codes.
  • If we return a value in the final block and no need of keeping a return value at the end of the method.

Example 1

public class CatchReturn {
   int calc() {
      try {
         int x=12/0;
      } catch (Exception e) {
         return 1;
      }
      return 10;
   }
   public static void main(String[] args) {
      CatchReturn cr = new CatchReturn();
      System.out.println(cr.calc());
   }
}

Output

1

Example 2

public class FinallyReturn {
   int calc() {
      try {
         return 10;
      } catch(Exception e) {
         return 20;
      } finally {
         return 30;
      }
   }
   public static void main(String[] args) {
      FinallyReturn fr = new FinallyReturn();
      System.out.println(fr.calc());
   }
}

Output

30

31)Will a finally block execute after a return statement in a method in Java?

Ans)Yes, the finally block will be executed even after a return statement in a method. 

The finally block will always execute even an exception occurred or not in Java. If we call the System.exit() method explicitly in the finally block then only it will not be executed. There are few situations where the finally will not be executed like JVM crash, power failure, software crash and etc. Other than these conditions, the finally block will be always executed.

Example

public class FinallyBlockAfterReturnTest {
   public static void main(String[] args) {
      System.out.println(count());
   }
   public static int count() {
      try {
         return 1;
      } catch(Exception e) {
         return 2;
      } finally {
         System.out.println("Finally block will execute even after a return statement in a method");
      }
   }
}

Output

Finally block will always excute even after a return statement in a method
1

32)Is there a case when finally block does not execute in Java?
Ans)when thread is dead
 when exception throws in finally block
when we call System.exit()

33)How to execute a static block without main method in Java?
Ans)

VM first looks for the main method (at least the latest versions) and then, starts executing the program including static block. Therefore, you cannot execute a static block without main method.

Example

public class Sample {
   static {
      System.out.println("Hello how are you");
   }
}

Since the above program doesn’t have a main method, If you compile and execute it you will get an error message.

C:\Sample>javac StaticBlockExample.java
C:\Sample>java StaticBlockExample
Error: Main method not found in class StaticBlockExample, please define the main method as: public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

If you want to execute static block you need to have Main method and, static blocks of the class gets executed before main method.

Example

Live Demo

public class StaticBlockExample {
   static {
      System.out.println("This is static block");
   }
   public static void main(String args[]){
      System.out.println("This is main method");
   }
}

Output

This is static block
This is main method

34)Why main() method must be static in java?
Ans)Static − If you declare a method, subclass, block, or a variable static it is loaded along with the class.

In Java whenever we need to call an (instance) method we should instantiate the class (containing it) and call it. If we need to call a method without instantiation it should be static. Moreover, static methods are loaded into the memory along with the class.

In the case of the main method, it is invoked by the JVM directly, so it is not possible to call it by instantiating its class. And, it should be loaded into the memory along with the class and be available for execution. Therefore, the main method should be static.

When the main method is non-static

The public static void main(String ar[]) method is the entry point of the execution in Java. When we run a .class file JVM searches for the main method and executes the contents of it line by line.

You can write the main method in your program without the static modifier, the program gets compiled without compilation errors. But, at the time of execution JVM does not consider this new method (without static) as the entry point of the program.

It searches for the main method which is public, static, with return type void, and a String array as an argument.

public static int main(String[] args){
}

If such a method is not found, a run time error is generated.

Example

In the following Java program in the class Sample, we have a main method which is public, returns nothing (void), and accepts a String array as an argument. But, not static.

 Live Demo

import java.util.Scanner;
public class Sample{
   public void main(String[] args){
      System.out.println("This is a sample program");
   }
}

Output

On executing, this program generates the following error −

Error: Main method is not static in class Sample, please define the main method
as:public static void main(String[] args)

35)Why "this" keyword cannot be used in the main method of java class?
Ans)The static methods belong to the class and they will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference).

Example

public class Sample{
   static int num = 50;
   public static void demo(){
      System.out.println("Contents of the static method");
   }
   public static void main(String args[]){
      Sample.demo();
   }
}

Output

Contents of the static method

The "this" keyword is used as a reference to an instance. Since the static methods doesn’t have (belong to) any instance you cannot use the "this" reference within a static method. If you still, try to do so a compile time error is generated.

And main method is static therefore, you cannot use the "this" reference in main method.

Example

public class Sample{
   int num = 50;
   public static void main(String args[]){
      System.out.println("Contents of the main method"+this.num);
   }
}

Compile time error

Sample.java:4: error: non-static variable this cannot be referenced from a static context
   System.out.println("Contents of the main method"+this.num);
                                                    ^
1 error

ACCENTURE INTERVIEW QUESTIONS:

1. Tell me about yourself?
2. Tell me about your roles and responsibilities?
3. which framework you are using?
4. Which jar file you are using for Datadriven and explain?
5. How to get column from excel 3 coloumn, 2 row?
6. How to write and send the values to text box?
7. What is the difference between single / and // explain?
8. How many ways identify the filed in selenium?
9. Which is fastest?
10. What is difference between implicit wait and explicit wait?
11. Xpath questions?
12. What is interface? What is the use of interface?
13. What is abstract class?
14. What is the difference between interface and abstract?
15. What is static block?
16. What is purpose of static in main method? Without static main method class will be
working or not?
17. One static block, one main method, one constructor what is the execution flow? 18. What is web driver? Why we use web driver?
19. Which jar file you are using for web driver?
20. Webdriver define in which class?
21. What is difference between list and set?
22. Which class define in list and set?
23. How to select a particular value from drop down with examples and what is the
difference between select by value and select by visible text? 24. What is hash map and hash table in collections?
25. Class a {
result()
}
Class b extends a {
Result()
}
• In this scenario we calling class b method what is the output?
• In this case how to define super keyword in your class?
26. How to create/ call obj in interface?
27. How to create object for static class?
28. How to call/invoke the method of class b from your program?
29. What are the different methods in mouse events?
30. How to handle hover menus?
31. What is the difference between final and finally and finalize?






JAVA Selenium TestNG Maven Git API Testing BDD Cucumber Interview Questions

 Common test automation interview questions & topics one can expect for 5+ years experience

****************


*******

Java-Basic

*******

1. Types of polymorphism

2. Difference between override and overload

3. Methods that cannot be overloaded

4. Static block and instance block

5. Difference in Static and non static

6. Encapsulation and common use cases

7. Abstract vs interfaces

8. Inheritance in java

9. Methods that cannot be overloaded

10. Type casting in java

11. String buffer and string builder

12. Why string is immutable in java

13. How to handle exceptions

14. Can I write try catch without the catch block

15. Difference between throws and throw

16. Use of iterator in java

17. Difference in Final, finally and finalize 

18. Boxing and unboxing in java

19. Increment and decrement operation

20. Variable Args

21. This and super keyword in java

22. Issues during Swtich case without break

23. Upcasting and downcasting

24. Baseclass of all class in java

25. Baseclass of error and exceptions

26. Access specifiers

27. Continue and break statement

28. Can main method return any value

29. Can we overload main method. What happens when overloaded

30.how to execute and statement before main method

31. Difference between == and equals()

32. Can user declare constructor as final

33. Can we cast any other type to Boolean data with type casting.

34.does java compile if user use 'static public void' instead of 'public static void'

35.can we use this() and super() in a constructor

36. Can we create object of abstract class

37. Can we create reference for an abstract class

38. Can we declare a class as static

39. What is instanceOf keyword

40. What's the load factor of HashMap

41. How to prevent a class from being sub classes

42. Final variable, final method and final class

43. Ways to create a string variable.

44. What is gc() - garbage collector

45. Subclass and innerclass

46. Infinite loop in java

47. How to make copy of an element

48. Checked and unchecked exceptions


*******

Java Collection

*******


1. Classes inside List interface, Set interface, Map Interface

2. Arraylist vs Linkedlist

3. Arraylist vs array

4. Arraylist vs vector or stack

5. Which class of List Interface to be used if user have more insertions and deletions

6. Which class of List Interface to be used if user have more retrieval

7. Set Interface: HashSet, TreeSet, SortedSet

8. Map - HashMap, HashTable, TreeMap, LinkedHashMap.

9. Stack and Queue

10. How to maintain insertion order in Set, List and Map

11. How to sort elements in ascending order in Set and Map


*******

Java Programs

*******


1. String reverse

2. String Palindrome

3. String Anagram

4. Find occurrences of characters in a string

5. Find the count of Capital and Small letters in a string

6. Remove duplicate characters from string

7. Swap to numbers without temporary variable

8. Reverse number

9. factorial

10. Fibonacci

11. Count number, alphabet and special characters

12; Print the below format

input String str="My name is Ramesh ch";

you should print the output:

Ramesh ch name is My

13)Print occurrence of each character in given string and also remove duplicates and print the string

String str="aaaabcccpqvswweeee"

1)output

a=4

b=1

c=3

p=1 q=1v=1w=2 e=4 s=1

2)after removing duplicates output string

abcpqvswe

14)Write a program for method overloading and method overriding ?



*******

Selenium

*******


1. Difference in driver.get() and driver.navigate().to()

2. Navigation methods in selenium

3. What is POM

4. Implicit wait 

5. Explicit wait- use of explicit wait, how to ignore exceptions using explicit wait

6. Fluent wait

7. Examples for expected conditions in explicit wait

8. Default timeout of pageLoadTimeout.

9. Use of desired capabilities

10. Use of chromeOptions, firefoxOptions ,ieOptions, etc.

11. How to disable notification in selenium.

12. Difference between getText() and getAttribute()

13. How to extract css property value

14. Difference between driver.close() and driver.quit()

15. How to handle dropdown elements with select tag and without select tag.

16. How to handle frames and windows

17. How to switch back to parent window.

18. How to perform page scroll in selenium

19. Use of Robot keys

20. Use of AutoIt

21. Use of Sikuli

22. How to perform File Upload

23. How to click or send value to an element without using element.click() and element.sendKeys()

24. Relative and absolute xpath

25. Explain few Xpath functions

26. How to login to site showing authentication popup in selenium

27. Mention few selenium exceptions

28. Difference between single slash and double slash.

29. What are the scenarios that cannot be automated using selenium.

30. How to perform right click on selenium

31. Action class and it's methods

32. Use of HtmlUnit driver

33. Can we create an object of the WebDriver() in selenium?

34. What is stale element exception and how to handle it.

35. Xpath and CSS selector


*******

TestNG

********

1. Annotations in testng

2. Difference between @BeforeTest and @BeforeMethod

3. Soft assert vs Hard Assert

4. How to pass parameters to test methods

5. Use of data provider

6. Use of invocationCount, enabled, priority, dependsOnMethod, dependsOnGroups, alwaysRun, dataProvider, groups, timeout, expectedExceptions, singleThreaded, etc

7. testNg xml structure

8. How to group testcases

9. Use of IRetryAnalyzer class

10. How to run failed testcases

11. How to perform parallel testing.

12. What level user can perform parallel testing

13. Use of ISuiteListener Methods

14. Use of TestListenerAdaptor methods

15. How to ignore packages and classes.

16. Can user provide negative value for setting priority.


*******

REST API

*******

1. Client/server Error Codes

2. Success codes

3. Use of GET, PUT, POST, PATCH, DELETE

4. Difference between Put and Patch

5. Difference between Put and Post

6. How to handle authentication

7. Difference between webserver and API

8. Json/xml structure format 

9. How to validate json response

10. Use of JsonPath

11. How to construct json body for Put, Post, Patch request.

12. Use of JsonObject.

13. What's is URI

14. What's a resource

15. What are the common headers used.

16. Common content types


*******

GIT

*******


1. Use of common commands used:

       add, status, commit, push, pull, restore, checkout, clone

2. How to handle merge conflicts

3. How merge issues occur.


*******

Cucumber

*******


1. keywords used inside CucumberOptions

2. Difference between DryRun and Strict in cucumberOptions

3. And/OR operation in Tags

4. Annotations in Cucumber

5. Use of order function inside cucumber annotations

6. Use of background keyword

7. Keywords used in cucumber

8. How to perform singleline and multiline comment in cucumber

9. How data is passed in cucumber

10. Use of ScenarioOutline and example

11. What is dataTable

12. Can user provide multiple examples for one scenario outline


****************

Hoping that the above mentioned topics and questions will helps you to clear your interviews.


All the best for your job hunt👍

Have a good day.

Waterfall vs Agile: Difference Between Waterfall and Agile Methodologies

 One of the most challenging tasks faced in project management is deciding what software to choose and how to organize the work. Both of these challenges are overcome if the main concern is reduced to the development methodology. You must learn about agile methodology steps and phases which can help to understand further in detail.

The two most essential and popular methods of managing projects in today’s modern software development industry are:

  • Waterfall- Can be termed as a traditional method of software development 
  • Agile- This belongs to a specific category of Rapid Application Development. It is more recent than Waterfall (2000s), and it operated along with Kanban or Scrum. 

Even though both the methodologies of software development are dependable and serve the same function of ruling out the best possible approach to get a project done in the least amount of time, they do their jobs very differently. 

Key Differences Between Waterfall and Agile 

While both seem to be two sides of the same coin, they do have their share of differences. 

Key Differences Between Waterfall and Agile Methodologies

Waterfall methodology is a model in which each stage of the product’s lifecycle occurs sequentially. The progress of the project flows progressively downwards through phases mimicking a waterfall. This kind of model considers a one-time massive whole delivery. Product/s are delivered at the end of the SDLC.

Agile methodology is a model which follows a proper sequential, linear, and an iterative approach. It is termed agile because it is swifter and has a more flexible approach to project management.   This model allows delivery in multiple and small chunks at definite time intervals. A Minimum Viable Product (MVP) is delivered at the end of each sprint.

Waterfall methodology divides the software development lifecycle into different phases. Therefore, it comprises of a single cycle and single release.

Agile methodology divides the software development lifecycle into sprints. Therefore, it comprises of a repetitive number of iterations and several releases.

Waterfall methodology can be said to be very structured and rigid in terms of its model.

Agile methodology model is extremely flexible.

In Waterfall methodology, the distance between the customer and the developer is long. Long-term planning scale, along with a longer time between specification and implementation.

In Agile methodology, the distance between the customer and the developer is short. Short term planning scale, along with a shorter time between specification and implementation.

In Waterfall methodology, detecting problems within takes a lot of time. High project schedule risk

In Agile methodology, problems are discovered very efficiently and quickly. Low project schedule risk.

Waterfall methodology’s ability to quickly respond to changes is less. 

Agile methodology: high ability to respond quickly to changes.

In Waterfall methodology, the testing phase occurs after the development phase is completed.

In Agile methodology, testing is usually carried out in parallel with the development phase so as to ensure consistent quality.

Waterfall methodology is quite fitting for projects which have definite requirements and those where the constant modification or changes are not needed.

Agile methodology is suitable for projects which continually evolve and those involving altering requirements. Learn more about agile methodology steps.

even though both Agile and Waterfall are the popular software development methodologies used in ERP projects, their methodologies are strikingly different. The image below captures the difference between the two very effectively.

[mpp_inline id="82848"] [mpp_inline id="84313"] [mpp_inline id="84315"] [mpp_inline id="84318"] [mpp_inline id="84320"] [mpp_inline id="84323"] [mpp_inline id="84325"] [mpp_inline id="84328"] [mpp_inline id="88834"] [mpp_inline id="90424"]

Source

Both Agile and Waterfall follow different ways of serving a common goal- to deliver the necessary result or product, free from bugs and errors, in the least time possible.  

Key Differences Between Waterfall and Agile Testing

Both Waterfall and Agile follow different approaches to their testing. The waterfall is not divided into many parts- but treated as one single, consolidated project which is, in turn, further divided into different phases.

Agile, on the other hand, is not a single entity but divided into multiple smaller projects, where each of the small projects has an iteration of different stages. Everyone must be curious about what is agile testing or what is waterfall testing lets know furthermore about it by going through the difference between them.

Key Differences Between Waterfall and Agile Testing

In Waterfall Testing, the testing begins after the development and builds phases of the process are completed. 

In Agile Testing,  The testing starts in concert with the development phase.

In Waterfall Testing, the process of planning is finalized and done before the testing phase.

In Agile Testing, the process of planning is not just done before the project starts, but also continues until its completion. 

In Waterfall Testing, the test plans are not revised during the project.

In Agile Testing, the test plans are reviewed after each sprint.

Waterfall Testing is very challenging to propose or implement any changes in the requirements once the process has started.

Agile Testing actively accommodates all required changes throughout the process.

In Waterfall Testing, test cases are created just once for all functionalities.

In Agile Testing, test cases are created after each sprint for the functionalities. 

In Waterfall Testing, the acceptance testing is performed only once by the client after the release.

In Agile Testing, acceptance testing can be conducted after each iteration. 

In Waterfall Testing, there is a clear distinction between the Test teams and the Development teams. 

In Agile Testing, the Test teams and the Development teams work as an integrated unit which allows them to have a free flow of communication. 

In Waterfall Testing, regression testing is hardly ever done, and it entails the execution of all the test cases.

In Agile Testing, regression testing is religiously done after each iteration and it entails only those test cases that are relevant.

Also read: Agile Methodology Interview Questions & Answers

The key to deciding which development methodology one should go for depends on five key considerations. They are as follows: Choosing between Agile And Waterfall 

  1. The ease of use
  2. Ability to integrate with other software
  3. Project reporting
  4. The flexibility allowed by the software
  5. High-level view of project statuses

Conclusion

In conclusion, if we look at Agile and Waterfall as whole software, they do highlight key differences. A smart project manager understands the differences and decides which one to implement as per project-specific requirements. If your project is short, simple and does not require changes and updates, Waterfall can be a first choice. But, if it is large, complex, and has to be changed and checked at intervals, Agile is the best working option.

Top Agile Interview Questions & Answers

1. What is Agile Testing?

 Agile testing is a practice based on the principles of agile software development. It includes all members of an agile team with specific skills and a certain expertise to ensure the timely delivery of a product with the release of additional features at frequent intervals.

2. How is Agile Methodology different than Traditional Waterfall process?

 In agile methodology, features of the software are delivered frequently, so that the testing activity is done simultaneously with the development activity. Testing time is shortened as only small features are need be tasted at once.

agile interview questions

While, in the waterfall model, testing activities take place at the end of the entire development process. Testing time, in this case, is as long as the entire product is to be tested in one go. Waterfall methodology is a closed process where all stakeholders are not involved in the development process whereas agile methodology requires the involvement of various stakeholders including customers 

3. What are the pros and cons of Agile Methodology?

This is one of the most frequently asked agile interview questions.

Pros of the agile methodology:

  • Speedy and continuous delivery of the software ensures customer satisfaction.
  • All the stakeholders (customers, developers, and testers) are involved in the process which leads to technical excellence and good design.
  • It facilitates close interaction between business people and developers.
  • Its flexibility ensures the adaptation to changing circumstances. Changes added at the last moment or at a later stage of development can be incorporated without any problem.

However, it does have some disadvantages too:

  • Sometimes when software deliverables are large ones, it is tough to determine the effort level required at the beginning of the software development lifecycle.
  • In agile methodology, documentation and designing take a back seat.
  • The decision making crucial for the development process comes with seniority and experience. Hence, freshers can hardly manage to find a place in the agile software development process.

4. What kind of projects is suitable for the Agile Methodology?

The traditional methodology is suited for projects with predefined, clearly stated requirements while agile development methodology is suitable for projects with dynamic requirements where frequent changes in the product come up on a regular basis.
15 Must-Know Spring MVC Interview Questions

5. What are the different types of Agile Methodologies?

An agile interview question and answers guide will not complete without this question. There are several types of agile development methodology. Scrum is one of the most popular and widely used agile methods. Other types of agile development methodology are; development like Crystal Methodology, DSDM(Dynamic Software Development Method), Feature-driven development(FDD), Lean software development and Extreme Programming(XP).

6. Difference between extreme programming and scrum?

Scrum teams usually have to work in iterations which are known as sprints which generally last up to two weeks to one month long while XP team works in the iteration that lasts for one or two weeks.
XP teams are more flexible as they can change their iterations while Scrum teams do not allow any change in their iterations.
The product owner prioritizes the product backlog but the team decides the sequence in which they will develop the backlog items in scrum methodology. Whereas XP team works in strict priority order, features developed are prioritized by the customers.
agile interview question and answers

7. Can you explain the lean methodology in detail?

Lean software development method follows the principle of “Just in time production”. It aims at increasing the speed of software development and decreasing cost.
The basic idea of lean is to reduce non-value-added activities (known as “wastes”) in order to increase customer value. The agile process itself is a lean method for software development lifecycle. However, activities like backlog grooming (when team review items on the backlog to ensure the appropriate items are in the backlog, that they are prioritized well, and that the items at the top of the backlog are ready for delivery) code refactoring (process of restructuring existing computer code – changing the factoring — without changing its external behavior) fits agile methodology more in tune with lean principles.

What is Test-driven Development: A Newbie’s Guide

8. What is Kanban?

Kanban is a tool which helps the team to keep a close eye the work i.e., to measure its progress. Apart from the progress, the status of a development story can be seamlessly described with the help of ‘kanban board’.
Kanban board aids in writing the whole scenario of a project at a single place to give a perfect picture of the bottleneck, a task done, workflow progress. It helps in the continuous delivery of the product without overburdening the team.

9. Is there any difference between incremental and iterative development?

Yes, the iterative methodology is a process of software development without any interruption. In this method, software development cycles consisting of sprint and release are repeated until the final product is obtained. Whereas, the incremental model is a process of software development where the product is designed, implemented and tested incrementally until the product is finished. It involves both development and maintenance.

10. What are burndown and burn-up charts in agile methodology?

To track the progress of an ongoing project, these charts are used. Burn-up charts indicate the work that has been completed while Burn-down chart shows the amount of remaining work in a project.
Why Companies are Looking to Hire Full Stack Developers

11. Can you explain pair programming and its benefits?

The combined effort in the team where one programmer writes the code and the other one reviews it is called pair programming. There are several benefits of pair programming, it not only improves the quality of code but also facilitates the knowledge transfer. It reduces the chance of mistakes as two people are simultaneously working on a code.

12. Do you know what is the scrum of scrums?

The term “Scrum of Scrums” is used when there are multiple teams involved in a project. It refers to the scaling of the daily Scrum meeting. In this scenario, each team is responsible for conducting and leading its separate scrum meeting. However, to maintain coordination and communication among all the different teams, a separate meeting must be conducted wherein all the teams participate. This is known as the “Scrum of Scrums.”

In this meeting, one team leader from every team (known as the “ambassador”), will represent their team. The main idea behind this is to encourage Agile teams to collaborate and coordinate their work with each other. 

[mpp_inline id="82848"] [mpp_inline id="84313"] [mpp_inline id="84315"] [mpp_inline id="84318"] [mpp_inline id="84320"] [mpp_inline id="84323"] [mpp_inline id="84325"] [mpp_inline id="84328"] [mpp_inline id="88834"] [mpp_inline id="90424"]

agile interview questions and answers

13. What is the velocity of a sprint and how it is measured?

Velocity is one of the planning tool used to estimate the speed of the work and time of completion of the project. The calculation of velocity is done by reviewing the work team has successfully completed during earlier sprints; for example, if the team completed 5 stories during a two-week sprint and each story was worth 3 story points, then the team’s velocity is 15 story points per sprint.
How to Become a Full Stack Developer

14. According to you what are some qualities that a good agile tester must have?

A competent agile tester must possess the following qualities:

  • They should be capable of understanding the requirements quickly.
  • An agile tester should be aware of all the agile principles and concepts and values as listed down in an agile manifesto.
  • They should be able to prioritize the work based on the requirements.
  • They should have excellent communication skills as continuous communication between business associates, developers and tester is a backbone of the agile development process.

15. Can you list some responsibilities that a scrum team have to undertake?

This is one of the important agile interview questions. Major responsibilities that a scrum team has to include:

  • Breaking down the requirements, creating tasks, estimating and distributing the created tasks. To put simply they are in charge of creating sprint backlogs.
  • They have to arrange daily sprint meeting.
  • It is a responsibility of the team to ensure that every functional feature is delivered on time. They have to create a sprint burndown diagram to know to get the exact estimate of work done and the work that needs to be done.

16. Mention the principles of Agile testing.

The principles of Agile testing are:

  • Continuous testing – This ensures the continuous progress of the product. An interesting aspect of the Agile testing process is that unlike the traditional methodologies where only the testing team is focused on product testing, it requires the entire team to participate equally in the testing process. 
  • Continuous feedback – With every test, the client feedback is encouraged to ensure that the product meets the business requirements of the client. 
  • Simple and clean code – Whatever errors and defects arise during the testing phase are fixed within the same iteration by the Agile team. This allows for simple, concise, and clean code. 
  • Less documentation – Agile teams use a reusable checklist. Here, they are more focused on the testing process rather than the incidental details.

17. Differentiate between Agile and Scrum.

A critical agile interview question you need to be aware of. Agile and Scrum have their fair share of similarities and differences. Since Scrum is a part of the Agile Methodology, both of them promote the completion of projects incrementally in small fragments. Also, both methodologies are iterative in nature.

However, the main difference between Agile and Scrum is that the former has a broader spectrum. While Agile Methodology is used for project management, Scrum is ideal for projects where the requirements change rapidly. In the Agile Methodology, leadership holds the most pivotal position, whereas Scrum encourages the creation of a self-organizing and cross-functional team.

What is Product Backlog Refinement?

Backlog grooming in agile scrum is a regular event where the development team and product owner review and refine the product backlog. The goal is to ensure the backlog items are clear, concise, and prioritize for upcoming sprints. The team can clarify requirements, adjust estimates, and reorder items to reflect the current state of the project. Backlog grooming helps to ensure the team has a clear understanding of the work to be done and improves the overall efficiency of the development process.

18. What are the crucial Agile Matrices? 

Some of the essential Agile Matrices are:

  • Velocity – It is essential to keep track of the project’s velocity so that the Agile team can have a clear about your progress, capacity, and other metrics. 
  • Work category allocation – Allocating separate work categories provides a clear idea about where different team members are investing their time and what is the order of priority of the various tasks in a project. 
  • Defect removal awareness – When team members work proactively and correct the errors simultaneously as they develop and test a product, the quality of the end product improves significantly.
  • Cumulative flow diagram – It represents a workflow in which the x-axis represents time, and the y-axis depicts the effort of members. 
  • Sprint burn-down matric – This allows the Agile team to track and monitor the completion of the work along with the sprint.
  • Deliver business value – It is primarily concerned with the overall work efficiency of the Agile team. Only when all the team members are productive that the Agile team can deliver business value to their clients. 
  • Time coverage – The time required to develop and test each iteration is measured using the ratio between the number of lines in a code (test suite) and the number of relative lines of codes.
  • Defect resolution time – As the name suggests, it pertains to the time required to detect and fix bugs and issues. This is an elaborate process that requires the Agile team to collaborate and deliver improved results in the most productive manner possible.

19. Explain “Zero Sprint” in Agile.

In Agile Methodology, Zero Sprint refers to the first step that comes before the first sprint. So, it is more like a pre-step to the first sprint. Thus, Zero Sprint would include a host of activities that are to be completed before starting a project, including setting up the development environment, preparing backlog, and other such tasks that are usually done before beginning the actual development process. 

20. What is the ideal duration of a Scrum Sprint?

The duration of a Scrum Sprint or the Scrum Cycle primarily depends on the project size and the team working on it. A Scrum team may consist of 3-9 members, and it takes about 3-4 weeks to draft and complete a Scrum script. Going by this calculation, the average duration of a Scrum Sprint is four weeks.

21. Explain the role of the Scrum Master.

One of the popular agile interview questions. The Scrum Master is the leader and supervisor of the Scrum team. The main job of the Scrum Master is to ensure that the team abides by the Agile values and principles and follows the agreed-upon processes and practices. Some of the most crucial responsibilities of the Scrum Master are:

  • To eliminate all the obstacles that could hamper the productivity of the Scrum team.
  • To establish a productive and collaborative work environment for the Scrum team.
  • To protect the team from the interruptions and distractions of the outside world.
  • To maintain a good relationship between the team, clients, and all the other stakeholders involved in a project. 
  • To supervise the operations of the Scrum team and motivating them as and when needed. 

22. Differentiate between “Sprint Planning Meeting” and “Sprint Retrospective Meeting.”

Although the two terms may sound similar, Sprint Planning Meeting and Sprint Retrospective Meeting are quite different from one another. A Sprint Planning Meeting involves all the Scrum roles – product owner, scrum team, and scrum master – coming together to discuss the project priorities and backlog items. Usually, the Sprint Planning Meeting is a weekly event that lasts for about an hour. A Sprint Retrospective Meeting, on the other hand, is one where all the Scrum roles (product owner, scrum team, and scrum master) come together to discuss the good and bad elements of the sprint and the sprint improvements. This meeting is generally an extension of the Sprint Planning Meeting and can last up to two to three hours.

Apart from these agile methodology interview questions, questions based on your previous experience in case you are already acquainted with agile methodology can be asked by the interviewer. You might want to revisit your on-the-job learnings and prepare answers to questions like:

    1. How long were your sprints for the projects you have worked on?
    2. What is the maximum number of scrum you have handled at a time?
    3. What kind of project management tools were used for your project?
    4. Have you used automated test tools earlier? How was your experience?
    5. Did your iterations overlap?