What were the interview questions asked to you for an automation testing role?

Below are the list of questions I’ve been asked during multiple automation testing interviews:

 

Note: Frequently asked questions are marked with a * (asterisk)

 

What are your roles and responsibilities in your current project, and which tools and technologies have you worked on?*

# Java :

 

What are the features of Java 8?*

What are the OOP concepts in java and give some examples where have you used each in  an automation framework?*

Difference between encapsulation and abstraction*+

Difference between abstract classes and interface*

Difference between overloading and overriding*

Why is overloading said to be compile-time binding and overriding is said to be runtime/dynamic binding?

Why is string immutable?*

When to use default method in an interface?

Exception Handling*

Difference between throw and throws

What will happen if I don’t write catch block?

When is finally block not executed?*

Difference between final, finally, finalize?*

Difference between static and final keywords*

When is synchronized, keyword used in methods?

Can final methods be overridden?*

Can static methods be overridden?*

Can static methods be called by creating an object?*

Can a static method call a non-static method?*

Why is static keyword used in methods? Can you give an example where have you used in your automation framework?*

Explain the collection framework*

What are the types of collections and explain each?*

Difference between String,  

Difference between Comparator and Comparable

Difference between Hashmap and Hash set

Can we store a duplicate key in a HashMap?

When would you use a List, Set, Map?*

Implementation of Vectors and Hashmap

Can you call multiple constructors within a constructor?*

What is the order of execution of constructors in terms of multi-level inheritance? Which constructor would be called first?

Suppose there are 2 classes - A() and B(). Class B() extends Class A(). How would you use a method from Class A() into Class B()?

Explain public static void main(String arms ,*

Can there be multiple main methods? Or can be asked as can you overload main method?

What is Serialization 

How would you start multiple threads?

What is a singleton class? How would you create a singleton class?

# Java Programs:

 

Trace the output questions. Many are available on websites 

Reverse a string without using in-built reverse() method

Program for bubble sort.

Print prime numbers and provide the total count in a given range

Star pattern programs

Find second-largest number in an array

Find second most frequently repeated character from a given string = successes

Find the count of occurrences of each word in a sentence {Most commonly asked}*

Count occurrence of each character/integer in an array {Most commonly asked}*

Sort integers in an array without using Inbuilt sort method*

Remove duplicate elements from a list

To fetch values from database

Find the union of 2 arrays. Arr1={1,2,3,4} and Arr2={3,4,5}. Output={1,2,3,4,5}

Some mathematical formula calculation programs:

# Generate output with below calculation. User will input number n.

# n*n - (n-1)*(n-1) + (n-2) * (n-2) - (n-3) * (n-3) + (n-4) * (n-4).... (1) * (1)

#Data Structure:

 

What are the various types of data structures?

Difference between a single linked list and a doubly linked list.

How to remove/insert an element from single linked list/doubly linked list.?

Explain the scenarios where you can use linked lists and arrays.

Difference between a Queue and a Stack.

Do you know about Breadth First Search (BFS) and Depth First Search (DFS)

# Design Patterns:

 

Explain the design patterns which you have used in your framework.*

Explain below and when would you use each:

Page Object Model*

Builder Pattern

Factory Pattern

Singleton Pattern,

# Selenium:

 

Explain Selenium architecture.

What are the different types of wait? Can also be asked as How do you handle synchroniszation in selenium?*

How to take screenshots?

How to check if all the links on the page are working without clicking on any of the link?*

What are various exceptions you have come across and how did you handle it?{commonly asked

Name all the interfaces used in selenium*

Explain the code Webdriver, driver = new Chromedriver,(); Internal working when this line is executed*

How to switch to frame/ alerts/ window/ tab?*

What are the inbuilt methods for Alerts?

How to find the names of all open tabs ?

How to find attributes of an element?

How to fetch the text of an element?*

Difference between inclement() and inducement(). Can also be asked as - If there’s an element on the webpage which may or may not appear every time. How do I handle it such that there is no exception thrown?*

Name all the type of locators*

What are the 2 types of xpaths

How does path traverse within the DOM?

Write an path to return the count of rows in a table contains the word ‘Testing’. Or will be asked to write find element by opening some website. Or using Advanced Xpath functions.*

Can CCS Selector traverse backward in the DOM

Which locator do you think is the best and the worst locators to be used?

I have a webpage with 10 text boxes having same name, same attributes, same ID class name, everything same. How would you find the second last text box?*

How to validate text from a text box which disappears on clicking inside the text box?

What are the alternate ways of entering text into a text box without using senders method?*

How to check if the values in the dropdown are in ascending order?

Suppose there is a button which downloads a PDF file on clicking on it. How to download a file and save it to a particular location ?

#BDD using Cucumber:

 

What are the latest features of cucumber 6?

Explain how would you create a cucumber project.*

Explain Cucumber runner class and write the code for it.*

Explain feature file. Can you write a feature file containing a test case for logging into the website user name and password?*

Various ways to pass data from the feature file?*

Difference between Scenario Outline and Data Tables.*

What are hooks?*

Difference between ‘@Before hooks and background.

How to re-run failed test cases in Cucumber?

How to check if all the statements of the feature file have been implemented into Step Definitions without executing any text cases?

What is glue, dry run, strict, monochrome?

# API Testing:

 

Difference between a REST and SOAP API/ 

 

.

 

Enjoyed this article? Stay informed by joining our newsletter!

Comments

You must be logged in to post a comment.

About Author