0% found this document useful (0 votes)
78 views70 pages

Interview Series

Uploaded by

manju varshini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views70 pages

Interview Series

Uploaded by

manju varshini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

1. How to use method overloading and overriding?

Method overloading
Writing Multiple Methods with Same name but Different Signature Is known as
Method Overloading. Both Static & Instance methods can be overloaded.

Method Overriding
Deriving properties from Super Class to Sub class. Hence it will be override the
methods in sub class @Override

2. How to differentiate between an abstract class and an interface?

Abstract class
A class is declared by using abstract keyword is known as abstract class.

Interface
It is a java definition block used to define data members and methods
Data Members by default static & final
Methods are by default public & abstract

3. How to manage the absence of multiple inheritance support in abstract


classes?

4. How do you utilize constructors?


.. It is a special member function of class which will have the same name as that of
class.
.. Constructors are used to initialize an object.
.. Constructor will be called automatically when we create object
..Hence they don’t have any return type.
..In java every class will have either default constructor & User defined Constructor.
5. How to work with different types of collections?

6. How to distinguish between an array list and a hash map?

Array List Implements List Interface Hash map implement map Interface
Array List maintain Insertion Order Hash map doesn’t maintain insertion
order
Array List allows Duplicate elements Hash map doesn’t allow duplicate
elements
Array List contains Dynamic array List Hash map contains collection Key value
pairs

7. How do you effectively handle windows pop-ups?


Selenium doesn’t support windows pop up. So we can handle third party application
such as Auto It. Using these application we can handle windows popup

8. How to implement different types of waits?

Mainly Classified  Implicit Wait


 Explicit Wait
 Fluent Wait
9 . How to utilize getWindowHandle and getWindowHandles effectively?

WindowHandle is a unique Identifier that holds the address of all windows.


getWindowHandle – helps in getting the window handle of current window.
It will return String

getWindowHandles – helps in getting the window handles of all opened windows


return type of getWindowhandles is set the values
10. How to handle various types of exceptions in your project?

11. How do you use TestNG annotations in your testing process?

12. How to write code for executing a single test case multiple times?

Using Invocation Count & Data provider

13. How do you repeatedly run a single test case in your testing suite?

TestNG provide a keyword @Invocation Count. Need to pass specify number. It will
run as per the count
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="MyTestSuite">
<test name="MyTest">
<classes>
<class name="com.example.MyTestClass" />
</classes>
</test>
</suite>

14. What challenges did you encounter in your project, and how did you
address them?
Set Up the environment for every test case
Maintain List of cases running in pipeline.
Picking cases is very difficulty
15. How do you make use of BeforeClass and AfterTest TestNG
annotations in your testing framework?
@BeforeClass method is used when the test case involved setup. Suppose test case
run in chrome so for launching and maximizing and accept cooking some other
Desired Capabilities

@AfterTest method is used to clear the tear down part. Suppose After done my case
need to close browser and kill the chrome process

16. How do you generate reports, and what is the process behind it?
17. Can you explain the code responsible for generating reports in your framework?

18. How do you approach writing Java programs for logic, such as
reversing a string or identifying repeated numbers in a sequence?
Done with logic and checked in Repo

19. How do you handle hooks in Cucumber during your testing scenarios?
20. How do you craft a Cucumber feature for your specific testing requirements?
21. Can you elaborate on the design and implementation of your testing
framework?
22. How do you pass data effectively within your testing framework?
23. Are there specific practices related to Agile ceremonies that you find beneficial
in your testing processes?

=== 10 Q ==

1) What are different types of waits?

Implicit wait

Explicit wait

Fluent wait
2) what is difference between implicit and explicit wait?
Implicit wait

Implicit wait in selenium is used to tell the web driver to wait certain amount of time
before throwing

” no such element exception”.

The default time is 0. Once we set the time web driver will wait for element before
throws exception

driver.manage().timeout.Implicitwait();

Explicit wait

Explicit wait in selenium is used to tell the webdriver to wait certain condition before
throws

“Element not visible”

Once we declare explicit wait we have to use Expected Condition

WebDriverWait wait = new WebDriverWait();

Wait.untill(ExpectedCondition.visibleofText());

3) What are different object locators in selenium?

In selenium Objects locators are used to identify and locate web elements in web
page. So that we can interact with them through script.

ID, NAME, CSS Selector, XPATH, Link Text, Partial Link Text, Class Name, Tag Name

4)Which object locator is preferred?

Id Locator in selenium is the most preferred and fastest way to locate desired web
elements on web page. ID selenium locators are unique for each elements in DOM. It is
considered fastest and safest method to locate elements

5) what is difference between hash map and hash table?

6) What is interface?

It is a java definition block used to define data members and methods

By default data members will be static & final


Methods public & abstract

7) OOPS Concepts

!!!!
8) What is difference between interface and abstract class?

Declared using abstract keyword Declared using Interface keyword


Can have various types of access All methods in Interface by default Public
modifier
Support Single Inheritance Support Multiple Inheritance
Can have abstract method as well Can have abstract method & default
concrete method methods

9) Exception handling
!!!

10) how to reverse the words in the string?eg: i like program language java ?

Done with logic and checked in Repo


11)Using hash map,how to find no of occurences of a character in the string?
!

12) Which access modifiers can be used in interface?

In Java Interface have certain restriction to use access modifier. Support Static ,final &
public access modifier in java

public interface MyInterface

public static final int MY_CONSTANT = 42; private static final int
MY_CONSTANT = 42;

public abstract void myMethod(); private abstract void myMethod();

13)access modifiers in java and its scope?

Java support the following access modifier

Default: Scope: Accessible with the package

Public: Scope: public members can be accessible with in package & outside package

Private : Scope : private members can be accessible with in the class

Protected :Scope :
Access
Modifier Visibility
public Accessible from anywhere (within and outside package).
Accessible within the same package and by subclasses (even in
protected different packages).
Accessible only within the same package. (No modifier
Default specified.)
private Accessible only within the same class.

14) What is difference between scenario and scenario outline?

Scenario

Scenario describes the steps and expected outcome for a particular test case

Scenario Outline

Same scenario can be executed multiple set of data using scenario outline.

The data is provided by tabular structure separated by ||

15) Can main method be overloaded?

Yes. In java Main method can be overloaded. Overloading refers to the multiple
methods in same class with the same name but different signature.

16) Can main method be override?

No. In java the main method can’t be override. Because the main method is a static
method belongs to the class. But in override we need create instance object.

Overriding in Java is associated with dynamic polymorphism and is not applicable to


static methods.

1. What are the OOPs concepts u hv worked on?

2. Test Order in Test NG ?


<Before Suite> <Before Test> <Before Class> <Before Method> <@Test – Method1>
<After Method> <After Suite> <After Test> <After Class> <After Method> <
@Test—Method2 ><After Method>

3. Data Provider in TestNG? how it works? what is the return type?


4. What is constructor? Why is it used? Where u cannot use constructor?

It is a java special member function of class which will have same name as that of
class. Constructors are used to initialize an object. Inheritance &
Static class cannot use

5. What is inheritance? Can we use inheritance in Interface?

Deriving the properties from one class to another class is known as “Inheritance “.
The class from where the properties are inherited is known as super class.
The class to which the properties are inherited is known as sub class .
Yes in java we can use Inheritance in interface. Interface inheritance achieve by using
extend keyword code reuse is advantage

6. What is multiple inheritance?

7. What is the return type of getWindowHandles?

GetWindowHandles () return all windows opened by the same web driver Including all
parents and child window. Return type of getWindowHandles() is Set<String>. The
return type is set as window handle is unique
8. What is the return type of hashmaps?
9. What is abstract method? can we write static methods in abstract class?
10. can we create constructor of abstract class?

Yes
11. how u generate reports of ur Framework? how do report pass/fail of a step?
12. what are collections and hashmaps?
13. tell me the syntax of hashmaps. How do u print the output of hashmaps?

14. where do u store ur data of ur framework? how to do u work wit excel sheet with
ur framework?

Apache POI is an open source java library to manipulate file format based on Microsoft
office. We use XSSF (XML Spread sheet format) to read & Write an excel

15. how TestNG teardown works?

16. what is findElements? when u can use it and why?

Find Elements is used to find all the Elements in the current web page matching to the
specified locator value. All the matching elements would be fetched and stored in a
list of web elements. List<WebElement>ele =
driver.findElements(By.xpath(“//id”));
17. why is string immutable?

18. What are the annotations u used in TestNG?

The following list of annotations used in TestNG


@Priority
@AlwaysRun
@DataProvider
@Expected Exception
@Groups
@Invocation Count @Invocation Timeout
@dependsOnGroups
@dependsonMethods
@timeout
@SkipFailedInvocation

19. Can we write non-abstract methods in Interface?

What is the Collection Framework in Java?


What are the main interfaces in the Collection Framework?
What is the difference between a Set and a List?
What is the difference between a HashMap and a HashTable?
What is the difference between an ArrayList and a LinkedList?
What is the difference between an Iterator and a ListIterator?
What is the difference between a TreeSet and a TreeMap?
What is the difference between a HashSet and a LinkedHashSet?
What is the difference between a Queue and a Stack?
What is the difference between a Comparator and a Comparable?
What is the purpose of the hashCode() and equals() methods in the Object class?
What is the difference between a ConcurrentMap and a ConcurrentHashMap?
What is the difference between a CopyOnWriteArrayList and an ArrayList?
What is the difference between a CopyOnWriteArraySet and a HashSet?
What is the purpose of the toArray() method in the Collection interface?
What is the purpose of the forEach() method in the Iterable interface?
What is the purpose of the stream() method in the Collection interface?
What is the purpose of the Collectors class in Java?
What is the difference between the Collection and the Collections class in Java?
What is the difference between fail-fast and fail-safe iterators?
What is the difference between the remove() and removeAll() methods in the Collection interface?
How do you create an immutable collection in Java?
What is the purpose of the EnumSet class in Java?
What is the purpose of the BitSet class in Java?
What is the difference between the List and the ArrayList classes in Java?

TestNG Questions

1. Have you conducted cross-browser testing using TestNG?

2. Is it possible to pass test data through a testng.xml file, if yes how?

3. What is a TestNG framework? what are the features of the TestNG framework?

4. How do u perform parallel testing in TestNG?

5. Why are we using TestNG? what are the benefits we get using TestNG? cant we execute test cases
in order without using TestNG?

6. How to prioritize the TestNG classes using testng.xml? How many ways to do it?

7. What all annotations used in TestNG in ur project?

8. Tell me some more annotations in TestNG

9. How to run specific kinds of test cases using TestNG?

10. what is @dataProvider annotation? what is the return type of this annotation?

11. What is TestNG?and its annotations?

12. What is parameterization in TestNG?

13. What are the annotations in TestNG and it�s the sequence
14. Difference between JUnit and TestNG

15. How to do grouping in TestNG?

16. Data providers?

17. If we wanna do data-driven with testng what are all annotations required?

18. How to conduct cross-browser testing Parallels in TestNG?

19. Difference between before test and before a method

20. Explain abt parallel testing

21. What is @DataProviders

22. What is the listener in TestNG? List those listeners which you used in your company?

23. How to prioritize test cases in TestNG?

24. When your @BeforeSuite will execute?

Rest- Assured API Automation Interview Questions for experience.


1. What is difference between API and WebService.
2. What is difference between SOAP & Rest API.
3. Can you write a sample of API(URL) and JSON.
4. How do you handle Authentication token.
5. How many type of Authentication in POSTMAN/ Rest-Assured.
6. What is difference between OAuth1.0 and OAuth2.O ,When and where do you use and how. Can you
write a sample code.
7. What is baseURI in RestAssured.
8. Can you explain RequestSpecification request = RestAssured.given();
9. What will be returned type of response.jsonPath().getJsonObject("XYZ");
10. How do you extract the values of JSON and how do you validate response.

11. Can you write a code of save the response in a JSON file.
12. How do you validate headers of response.
13. What is difference between Headers and Header class.
14. What is difference between response.header(“xyz”) and response.headers() methods.
15. Can you extract all the headers from response at run time.
16. What is JSONObject() , request.header(“xyz”), response.path(“lable”) , response.body().asString() ,
response.getBody().prettyPrint(); , RestAssured.given().queryParam(“xyz”,”abc”);
17. What is difference between request.get(“https//https://lnkd.in/drymuszU) and
request.request(Method.GET,"/ allcustomers ");
18. What is difference between PUT and Patch . Have you ever used and where.
19. What are status code(2xx ,3xx ,4xx, 5xx) in API.
20. How do you print your response in JSON format.
21. How do you post body in POST and how many way to post.
22. What all are the dependency for Rest-Assured.
MindTree Interview Questions:
Technical:
a) Tell us something about your work, experience, project and how are your doing in your project?
b) In Financial products being developed what Software Model would you suggest for Developers, is it
Agile or Scrum and why?
c) What are the limitations of Scrum model
d) What Automation Architecture are you following in your project?
e) What kind of UI tests will be implemented if you have categorize based options to be choosen. For
ex:
If you select a category, 5 options are displayed, if you select 2nd category, 3 options are displayed.
f) What tools are you using in your current project and how are you implementing it
g) Although Jmeter is considered for Performance but it is not safe to use for highly sensitive and
confidential projects therefore tell us your suggestion about how are you going to implement
performance testing.
h) How to automation bar charts, pie charts?
i) How to handle the automation if bar charts and pie charts are taking time to display and if failed how
would you take screenshot?
j) Why are you looking for Job change?
k) How can you contribute yourself into our products since we are looking for person who is strong in
Finance (not in Insurance or Banking domain)
l) What is your current role and how are you managing it
m) How do you plan and estimate the project and corordinate with the developers
Personal:
a) During this COVID sitation, since everyone is working from home. How would you manage the
project
with other team members and get the things done on time?
Round 1- Technical
1. Write a program print occurrence of each charater in a string.
2. Write a program to print only alphabets from string and remove all digits and special characters.
3. How would you print a string with double quotes? Ex: output string= "Hello".
4. Write code for Db connection.
5. Different type of waits in selenium.
6. How to find broken links on any web page.
7. Setting job in jenkins.
8. Use of Maven.
9. Api basic operations.

Round 2- Technical+Mangerial
1. Difference between Arraylist and Arrays? Explain underlying data structure for them.
2. Hashmap and its use.
3. Frames in selenium
4. Challenges faced in automation. Be ready for counter questions.
5. Why are you looking for job change?
6. Have you worked on Api testing? No much cross question as i told i have only basic knowledge.
6. Have you worked on Batch execution?
8. Have you worked on Javascipt based framework, ex. Mocha,Cyprus etc?
Accenture interview questions:

• 1. Explain OOPS concept.


• 2. Explain OOPS concept in your Selenium project.

• 3. Which type of variables can we have in interface? Can we have non-static variables?
In Java Interface can only have constant variable. Also know as static final variable.
You cannot have non-static variable in Interfaces
• 4. Can we have methods with body inside Interface?
Default, static, private methods.
• 5. Which version java are you using? JDK 21 Version
• 6. How to create read only classes?
• 7. Duplicate - return type of method - Method Overloading - Is it right?

• 8. How can you achieve Multiple Inheritance in Java?


Multiple Inheritance by using Interface we can achive
• 9. What is Diamond problem?
• 10. Can we change value of static variables?
No
• 11. Usage of super and this keyword?
Yes
• 12. Program: String str="32400121200";
Output should be: 00003241212 (all zeroes should be in starting)
Done
• 13. What is Exception handling? How to handle it?
I Know
• 14. What is Exception propagation?
• 15. Can we have try block without catch block?
Yes. In java you can have a try block without catch block. But it must be followed by either catch or
finally block. However if u include final block not mandatary.
• 16. Will finally block be always executed? Can I abort the program before running this finally?
In java always executed finally block. Regardless of exception thrown or not. However certain scenario
will terminate before finally block.
System.exit(0);
17. Sysout statement after finally block? Will it get execute?
• ---------------
18. OAUth 1 vs OAuth2 - Difference
19. https / http - security? - Difference?
20. Design pattern in APItesting framework
21. Any idea about BDD Cucumber?
Yes
22. Log4J levels - default
23. Appenders - Types?
• ------------
24. git merge
25. git conflict
26. git fetch
27. Ever check what is inside this -> .git folder?
28. XPath Axes :
Go to https://lnkd.in/dcDnHv7e
MOST ACTIVE section ->

29. Xpath for Change column (with Tata Steel) -> (//a[text()='Tata Steel']//parent::td)//following::td[2]

30. following vs following-sibling?

31. How can I check whether Tata steel is there in 1st column or not?

Infosys - Automation - 3 to 6 Years

Interview date:24th Aug

1 .There are two class suppose Class A and Class B. both the classes have the same methods. class B
extends class A We create the object of class B inside class B. Then which method will be called.

2. Write a program to remove the duplicate character from a string

DuplicateCharacter(char str[] , int length)

for (int I = 0; I <length; i++) I = 3


for(j = 0; j < I; j++) j = 0 to 3
if(str[i] == str[j])  break;
if(I = = j) 3 == 3
str[index] = str[i]+str[index] => str[0] = str[3] +str[0]

3 .Write a java program to reverse the string


ReverseString(String name)
String expected = “”;
String Lowername = name.tocharArray();
for(I = name.length-1; I >=0; i--)
expected = expected + Lowername.charAT(i);
4 .Write the java program to count the occurrence of character from a string
using HashMap collection to get the count of character

5 . There is a variable declared inside the Interface. Can we change the value of the
variable?
No it will throw compile time error. In java variables are declared inside Interface static,
Final, Public.
This means that they are constants and, once assigned a value, their value cannot be
changed. Attempts to modify the value of an interface variable will result in a compilation
error.
public interface MyInterface {

int MY_CONSTANT = 42; // This variable is implicitly public, static, and final

public class MyClass implements MyInterface {

public static void main(String[] args) {

// Compilation error: Cannot assign a value to final variable MY_CONSTANT

// MY_CONSTANT = 21;

6 . String is immutable or mutable.

!
7 . What is the difference between : WebDriver driver=new ChromeDriver(); ChromeDriver
driver=new ChromeDriver()?
Web Driver is interface . where as ChromeDriver is a class associated in webDriver
Intercafe.

8 .Web Driver is Interface or class? If it is an Interface then the methods which we are
using is written under which class?

Web Driver is an interface in Selenium, not a class. The Web Driver interface provides a set
of methods for interacting with a web browser. These methods define the operations that
can be performed on a browser, such as navigating to a URL, finding elements on a page,
interacting with forms, and more

9 .What is the difference between List and Set?

!
10 .What are the two different files used in Cucumber?

Feature File & Step Defination File


Wells fargo interview Experience

java Question:
1.Design Pattern--When and where to use in your Framework
2.How to achieve constructor chaining
3.Interface advantages over abstract class
4.Comparator , Compareable
5.Use cases of using Set, Map and List
6.Private Constructor usage
7.Pojo Class
8. To view exception in log any prefered method name.
9.String immutability
10.String Constant pull vs heap
11.Restict inheritence of a base class

Array Rotation
Array Swapping of 1st Element with Last Element
Palindrom without using inbuilt functions

Cucumber-
1.Details about @cucumberOptions
2.Parallel Execution
3.Dependecy Injection

Maven :

1.Life Cycle
2.Goal Settings
3.Settings.xml features

Git:
1.Fetch Vs Pull
2.how to resolve conflicts?

Selenium:
1.Stale element exception
2.JavaScript executor
3.WebDriver exceptions when it will cause

Mobile Testing :
1.Appium default port
2.Desired capability

TestNG:
1.Parallel Execution
2.Listners
3.Ignoring Test

Team Handling / Lead skills:


Leadership & Team Handling skills
Effort estimations

Manual Testing:

Verification vs validation
Functional vs non functional requirements
When to start teting for a new product which is yet to be develope
usecases of a public vending machine
L&T Automation Interview Insights! 🚀

Round 1:

Cucumber options
JDBC connection implementation
Creating multiple test runners
Achieving parallel execution
using TestNG XML file achive parallel execution
Or Run through CMD
Jenkins configuration
Undoing delete in Git
Palindrome program
List & set in Java
ArrayList & LinkedList differences
Clicking on the 4th element
using relative xpath.
Handling disabled elements in Selenium

WebElement web = driver.findElement(By.xpath(“”));

IJavaScriptExecutor executor =

Executor.executeScript(arguments[0].removeAttribute(“disabled”),web);
web.click();
Passing test data in Selenium

using @dataprovider annotation


public object[][] LoginData()
{
return new obect[][]
{
}
}
Opening a new window in Selenium

WebElement ele = driver.findElements(By.id(“Open New Tab”));


ele.click();
String MainWindowHandle = driver.getWindowHandle();
Set<String>allHandles = driver.getWindowHandles();
for(String handle : allHandles)
if(!handle.equal(MainWindowHandle)
driver.switchTO().Window(handle);
Overloading and overriding in Java
Overriding static and private methods
Unimplemented interface method scenario
Swapping variables without a third variable

Round 2:
Checking if a checkbox is selected
Right-clicking on an element
Understanding HTML tags
Difference between Scenario and Scenario Outline
Scenario Describe the steps and expected outcome to the particular testcase
Example of adding two numbers in Scenario and Scenario Outline
Scenario Outline example section vs. data table
Writing a test runner class
Experience with API testing

Sapient interview questions

java :
1) what is polymorphism?
Poly means meany & morphism means forms. The ability to get multiple forms
2) Exception handling ?
3) Difference b/w throw and throws?
4) what is file in and File out ?
5) How to write the data for notepad? write the code ?

6) What is abstract and interface with example ?


7) write a program fact using recursion ?
8) How will you handle multiple exceptions ?
In java we can handle multiple exceptions using multiple catch blocks. When multiple
exceptions throws with in a try block you can catch and handle each specific exception
individually.
try {

// Code that may throw exceptions

} catch (ExceptionType1 e1) {

// Handle ExceptionType1

} catch (ExceptionType2 e2) {

// Handle ExceptionType2

} catch (ExceptionType3 e3) {

// Handle ExceptionType3

} // ... and so on

Selenium :

1) explain selenium architecture?


2) write a xpath or make my trip application?
write the xpath for Holiday and no need to change the existing xpath .By using the same xpath you
need to identify the hotels as well.
3) Explain selenium grid how to setup?
4) How are you maintaining the logs in your framework?
5) Explain framework how you design?

TestNG

1) How will you execute the dependency test cases ?


2) How will you execute the 3 test cases at time ?
3) difference b/w Data provider and parameters?
4) what is the difference b/w Before Test and Before method ? How will it work? Give me an example ?
5) write the testng xml format ?

BDD:

1) What is BDD, why do people can prefer BDD nowadays ?


2) in BDD why before and after using ? Give me an example ?

Manual Testing :

What is a test strategy ?


What is the test plan ? How will you create?
how will you follow the agile process in your company ?
What is estimation?
Jenkins :

how you will create the job and how it will execute ?

What is OOPS?

Writing a program with the help of objects & classes is


known as
Object Oriented Programming Language ( OOPS ).

OOPS Concepts are classified into


1. Objects & Classes
2. Polymorphism
3. Encapsulation
4. Abstraction
5.Inheritance

What is an object?

An entity which has its own state & behavior is know an


object

State Represent characteristics of object

Behavior Represent functionality of object


What is a Class in java?

Class is a java Definition block which is used to define


State & Behavior of object.

In Class state represent data members & behavior


represent data members function

What is Constructor?

It is special member function of class. Which will have


same name as that of class.

Constructors are used to initialize an object.

Constructor will be called automatically at the time of


object creation

Constructor doesn’t have any return type.

In Java Every class will have either Default Constructor or


User Defined Constructor but not both.

What is default constructor?

If there is no Constructor in class. By default constructor


will there. Default Constructor always no arguments.
What is the difference between static and not static variable?

If we want to represent any common information like city,


country. Then they must be represent static variable

Static variable declared by using Static keyword

Static members will be loaded at the time of class loading

Only one copy of static members will be loaded at the time


of class loading

Static members belongs to entire class

If we want to represent Individual Information like name,


id they must be declaring as non static variable.

Non static variable declared by using no static keyword.

Non static members will be loaded at the time of object


creation

Non static members copy loaded depends upon object


creation

Non static members belongs to object


Constructor overloading?

Diff Type of arguments , length of arguments ,order of


arguments

What is inheritance in java?

Deriving the properties from one class to another class is


known as Inheritance.

The class from where the properties are inherited. Is


known as super class

The class to which the properties are inherited is known


as sub class

We can establish is-a relationship between two classes by


using Extend Keyword

Explain Different Types of Inheritance?

Single Inheritance
This type of inheritance will have single sub class &
super class
One Sub class & one Super
class
Multi Level Inheritance:

Multiple Inheritances

 In this type of inheritance a sub class will have more


than one super class.
This type of Inheritance not allowed in java.

One Sub class & More than One super


One child & more parent
class

Hierarchical Inheritance
 This type of inheritance one super will be extended
more than one sub class.

One Super class & More than One sub


class Super Class

Sub Class Sub Class Sub Class

Hybrid Inheritance

Difference between block & method?


METHOD BLOCK
It will have some name It doesn’t have any name
It will have some return type It will not have any return type
will be executed Explicitly Will be executed automatically

What is Diff between Constructor & Method.


CONSTRUCTOR METHOD
It is a special member function of class It will have some name
which will have same name as that of
class
Constructor will be called automatically will be called executed Explicitly
at the time of object creation
The job of the constructor is to initialize Method can be static or non static
instance variable of class
Constructor doesn’t have any return It will have some return type
type or value

IMP: Method & Constructor Overloading is possible.


Constructor overriding is not possible.

What is the diff between == & equal


== .equal()
In java == is consider as a operator Equals() is consider as a method
It is majorly used to compare the It is used to compare actual content
reference values and objects of objects

What is Upcasting and down Casting in java?


Converting Lower level data type to higher level data type. Is known as
Upcasting
Parent p = new Child();

Converting High level data type to Low level data type. Is known as Downcasting
Child c = new child(p)

What is Constructor Overloading & Overriding?

What is method overloading & overriding?


Overloading Overriding
If we want to perform one task in If we want to change the task itself
many ways then we will go for then we will go for overriding
overloading
It is a process of writing multiple It is a process of changing the
methods with same name but diff implementation of super class
signatures method in the sub class
Is a relationship not required Is a relationship required
Private, final methods overloaded Private ,final methods cannot
overridden
It is example of compile time It is example of Runtime
polymorphism polymorphism

What is use of This Key word & Super Keyword?


POLINDROME

MAM

If we tried to read Left To Right or RTL Both are Same

If(charArray[i] != charArray[name.length-1-i]

SelectByValue

SelectByIndex
SelectByVisibleText

What is Serialization ?

The process of Converting Java Object to JSON Object is known as Serialization

There are 2 popular 3rd party Libraries that can achieve serialization. JACKSON
& GSON

What is the diff between String & StringBuilder


String StringBuffer
In Java String is Immutable String Buffer is Mutable
String class slower while performing String Buffer class faster while
concatenation performing concatenation
String class uses string constant String Buffer Class uses Heap
pool Memory

What is sealed class

We created sealed class when we want to restrict the class to be inherited

What is Exception Handling?

Exception Handle in C# is the process of Handling Run time Error.


We are performing Exception Handling so that Normal Flow of Application Can
Maintain after Run time Error

Mainly Classified – Try, Catch, Finally, Throw


in C# Exception is an Event & Object which is thrown at run time

Exception classified into 2 ways


Checked Exception - Compile Time
Unchecked Exception – Run Time

What is Abstraction?
The process of Hiding Internal Implementation Logic and just
showing functionality to the user is known as abstraction
Fibonacci Series

Prime Number

Palindrome Number

Factorial Number

Armstrong Number

Generate Random Number

Printing Pattern

Compare Two Objects

Creating Object

Print ASCII value

.Net Frame Work


.Net Mono Frame Work
.Net Compact Frame Work
What is Synchronization?
When the speed of web page loading is not matching with the speed
of code trying to locate the elements in web page.
By using waits we can handle synchronization.
Implicit wait
explicit wait
fluent wait`
Driver. manage().Timeout().ImplicitWait(Duration.ofSec(1));

WebDriverWait wait= new WebDriverWait();


wait.until(ExpectedCondition.ElementLocated(By.xpath(“”));

What is Constructor Calling?


The process of calling one constructor from another constructor
within the same class or sub class
Recurcive Constructior Invocation not allowed
Advantages
Code Reusability
Encapsulaton
What is Encapsulation?
Encapsulation is a process of Binding the Data Members and
Methods tougher into a single Entity is known as Encapsulation.
Better Control & standardization of code
Ex: Class is Encapsulation of DM & Methods

Data Hiding is an example of Encapsulation

1.Declare all the data members of a class as private


2.provide getter & setter methods to access the private data member

What is polymorphism?
Polymorphism is a Greek word. Poly means many & morphism
means forms.
The ability to get multiple forms is known as polymorphism.
Code Reusability
Flexibility
Maintainability
Compile Time Polymorphism
1. Compile time polymorphism happens before execution of
program
2. Ex: Method Overloading, Constructor Overloading, Method Hide
3. Compile Time Polymorphism is also known as static
polymorphism

Run Time Polymorphism


1. Run time polymorphism happens During Execution of program
2. Ex: Method overriding
3. Run Time Polymorphism is also known as Dynamic
Polymorphism

What is System.out.println(); ?

System is a Final Class Represented in Java.lang package.


Out this is a Instance of print stream.
Its access specifiers are public and final.
It is an instance of java.io.PrintStream. When we call the member, a
PrintStream class object creates internally.

What is Java package? Default package?


Java package are used to store and hold Java related files like
classes, Interfaces and enums and records for better management.
Default java.lang package
Diff between Array & Array List?
How to Read Data throw XCELL?
XSSF = XML SPREAD SHEET FORMATE .
Java Apache poi Package
Diff Between Array & Collection
Array Array List
Array is Dynamically created object. ArrayList is a class in Java Collection
It serves as a container that holds Framework. It contains popular
the constant number of values classes Vector, Hash Map, Hash
Table.
Array is Fixed Size Array List is Dynamic Size
It is mandatory to provide size of We can create instance of Array List
Array while initializing without specifying size. Java create
Default Array List size
Array can store objects and Array List store objects only. Cannot
primitive data type store primitive data types
Array is Two Dimensional Array Array List is Single Dimensional
Array

How many ways to create objects?


There are few ways to create objects.
1. Using New Keyword it will create instance variable in heap
memory
Man m = new Man();
2. By Using NewInstance() method
3. By Using Clone() method
4. By using deserialization

Constructor can be overloaded not override

What are the interfaces used in selenium?


Commonly used interfaces in selenium including Web Driver,
Actions, JavaScript Executor, Web Element.

Where did u use Inheritance in selenium?


Inheritance is used to create custom utility classes and page object
class.
Different types of Exception?
1. Invalid Argument Exception
We get this kind of exception in selenium. When we don’t
specify HTTP & HTTPS in Get() command.

2. Unhandled Alert Exception


We get this kind of exception in selenium. When we close
the browser without accepting & dismissing alert that is displayed
on page.

3. Stale Element Reference Exception


When the web element you are trying to access is not
available in your DOM Structure.
The element has been deleted permanently.

4. Invalid Selector Exception


We get this kind of exception in selenium. We are passing
xpath expression & CSS selector with invalid syntax.

5. JavaScript Exception
We get this kind of exception in selenium. When we pass
JavaScript statement having syntax issues.

6. No Such Window Exception


We get this kind of exception in selenium. When we are
trying to switch the window but unable to find web driver.

7. Element Not Visible Exception


Element is present in the DOM but not visible. Hidden
element

8. Element Not Selectable Exception


Element is present in the Dom. But it may be disable.
9. No such Element Exception
We are trying find element but unable to find throwing
no such element

What is Robot Class?


Robot class is a native system events control by Keyboard & Mouse.
Import Java.awt.Robot;
Using Invocation count parameter and setting its value to int
parameter.

@Test (Invocationcount=10)

Using Depends on method parameter inside @Test Annotations.


Test method will run after after successful execution of depends
method

@Test (dependsonMethod={“Pre Test”})

Chrome Options options = new Chrome Options();


Options.addarguments(“--incognito”);
WebDriver driver = new ChromeDriver(options);
How to handle proxy in selenium?
Sometimes when u tries to access secure application we might get
proxy issue. Until we do not set proxy we can’t access application.
So in order to solve issue we can use SetHttpProxy.
Proxy p = new Proxy();
p.setHttpProxy(http://your-proxy-server:port);
ChromeOptions options = new ChromeOptions();
options.setProxy(proxy);

Project Configaration Data, Db data


Click () method provided by Web Element Interface. It is used to
click specific web Element provided by the locators such as id, CSS.
This method is straightforward and directly perform click on
specific locator.

Actions interface in selenium provided by the advanced user


interactions like drag and drop, moveToElement, clickonHold.

How to handle Hidden Elements in selenium?


1. Using Java Script Interface we can interact hidden elements
directly. Java script can access and manipulate regardless of
visibility.
Web Element e=driver.findElement(By.id("hiddenElement"));
JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("arguments[0].click();",e);

2. Using Actions Class Interface


In some case we can use action class to move hidden elements.
WebElement e= driver.findElement(By.id("hiddenElement"));
Actions actions = new Actions(driver);
actions.moveToElement(e).perform();
3. Using Explicit waits
sometimes hidden elements visible after certain actions like time
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement element =
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("h
iddenElement")));

4. Modify CSS
If the element is hidden due to CSS property like hidden : none
We can modify css selector using java script

Method overloading
Writing multiple methods with same name but different signature
like length, order & type of arguments.
Both static & Instance methods can be overloaded.
Since main method is static it can also possible to overload.
Constructor overloading is possible
1. Exception handle is a mechanism to handle run time error.
2. We can perform exception handling so that normal flow of
application maintained even after exception
3.Exception is an event or object trigger by the run time.
So mainly classified into two types.
Checked Exception
*.Compile Time Exception
Un checked Exception
*.Run Time Exception
Checked Exception occurs during compilation of program.
IO Exception: Thrown input / output operation failed.
SQL Exception: Throw when there is an issue with SQL connection
FileNotFoundException: Thrown when attempting to access invalid
file
ClassNotFoundException: Thrown when java run time cant find
specific class

Un Checked Exception occur during Run time of program

NullPointerException: Thrown when an attempt is made to access a


null object reference.
ArrayIndexOutOfBoundsException: Thrown when trying to access
an array element with an invalid index.
ArithmeticException: Thrown when an arithmetic operation results
in an error, such as division by zero.
String Buffer & String Builder

String Buffer String Builder


String Buffer was introduced initial String Builder was introduced java
release of java 5.
String buffer it is synchronized String builder is not a synchronized
It is a Mutable. We can modify It is a mutable
string without creating object
Slightly slower due to Faster due to lack of
synchronization synchronization
It is a thread safe. So multiple It is not a thread safe so little faster
threads cannot be accessed at the
same time. So little slow
It will store Heap Memory It will store Heap Memory

Final Keyword
1. Final is a keyword and access modifier. Which is Used to apply
restrict from class, methods, variables.
2. Final keyword is used within the class, methods & variables.
3. Once declared final variables become constant and cannot be
modified.
Final method cannot be overridden by sub class.
Final class cannot be inherited.
4. Final keyword executed when we call.

Finally Keyword
1. Finally is the block in java Exception handle. to execute important
code weather exception occur or not.
2. Finally block always related to try and catch block in exception
handle
3.Finally block is executed as soon as try / catch block executed

Finalize keyword
1. Finalize is a method in java.
2. Finalize method is used with the object.
3. Finalize() perform cleaning activity before destroying object

Can we execute without main method in java?


Yes. We can execute without main method using static block.
The below example work 1.7 version but latest version java jdk21
doesn’t allow to run .because jvm check main method before
initialize class

In java Interface can only contains method declaration without


implementation.
Interface also contains default, static methods. Which provide
method implementation with in interface .

Default Methods
Default methods are methods that have a default implementation
defined with in interface.

Static methods in interface


static methods in interface are methods that are declared with in
static keyword and provided static implementation with in interface

We can implements private methods.


Multiple Inheritances in java
We can implements interface in java.

Set List
Set is part of Collection Series List is part of collection series
List are interfaces and extended
super class
1. Linked List
2. Array List
String class uses string constant String Buffer Class uses Heap
pool Memory

What is This Keyword?


1. It is a keyword used to refer current object.
2. This keyword will refer only one object at a time
3. We want to use this keyword explicitly when variables name is
same as non static variable.
4. This keyword is used to constructor chaining within same class.

What is super keyword?


1. It is a keyword used to refer super class properties from the sub
class.
2. Super keyword must be used inside non static block or
constructor
3. Super keyword cannot be used inside static block
What is casting and different types?
The process of converting one type of information to another type.
It can be classified into 2: Type Casting
Method Casting
Type casting: The process of converting one type of data to another
type.
Again Type casting divided into 2 types: Narrowing
wideing
Boundary value analysis
Include values at the boundary level. If the input is within the
boundary values it consider as positive testing.
If the input is outside boundary then we can call negative testing.

First thing after login in my system I will check the active sprint in
jira. There I can see all assigned open task under my name.
After that I will check my mail is there any important mail that I
need to take action. daily scrum meeting happened morning. So we
will update yesterday & today tasks. If any major block or conflicts
discuss with SM, PO they will help to resolve issue.
 Give an example from your experience of how you influenced a stakeholder/client.
 How well do you fit into the automation testing team?
Point by point giving information about experience, qualification, specialskils And experience in
agile methodology
 What skills will you bring to the team if hired?
 How well can you communicate and possess a great attitude with others?
 How quickly can you learn things?
 How good you’re with respect to the concepts and Project architecture?
 What challenges that you face, and how did you overcome
 What diff bugs you filed while testing
 Were you able to think Out of the box?
 Are you a good team player and can adapt to the team environment?
 If he is technical, he may ask some technical questions related to problem-solving or simple
puzzle or debugging skills.
 You are placing an order, and suddenly the light goes off. How do you handle these situations
or scenarios while developing your framework? Means what and all checkpoints do you put?
Can anyone give the answer to this question?
 About yourself, professional and personal
 Previous project’s roles and responsibilities
 Achievements and failures in previous organizations
 What do you know about the company, like what product they work
Accenture is a global professional services company that provides a wide range of services and
solutions in strategy, consulting, digital, technology, and operations. More than 2k clients
 Why do you want to join that particular company?
 What is quality for you (Important)
 Difference between testing a software product and a software application
Software developed with respect to the specific customer requirement, called as software
application.
Software developed with respect to the overall requirement in market, called as software
product, the interesting customers are purchasing license of that product.
 Some testing-related behavior questions like what do you do when the developer doesn’t
accept your defect, how you give your estimates, how do you manage your time, will you
accept last minute changes- yes or no- why
 Where do you see yourself in 3-5 years
 How do you define success
 Strengths and weakness
My strengths are I am a quick learner and positive attitude and self-motivation.
My weakness is I am straightforward.
 How do you assign the task
it’s essential to first establish clear goals before assigning tasks.

Communicate task effectively to team members

Set achievable dead line

 How much % of the work do you do as a lead?


 Client interactions
 Documents you need to prepare as a lead
 What help have you provided to your team?
Mentorship we can help to other members to support, guidance and advice.
collaboration & communication
 What exactly is your Role
Develop Automation test cases
Test Script Maintenance, Execution of Automation cases
Analysis of test results
Collaboration with Development Teams understand requirments
 How much percentage of Test scripts must pass on a daily basis?
 Why Test script will fail
Sometimes cases failed due to new modifications done by dev.
Synchronization Issue
Environment Issue
 Explain Selenium Grid and what are the Systems and OS you have Automated; write code
 What is the role of a Quality Engineer in the software development lifecycle?
 How do you define and measure software quality?
 What is the difference between verification and validation in the context of software testing?
 Describe your experience with test planning and test case design.
 How do you approach identifying and prioritizing test cases for a given software application?
 What are the key components of a test plan, and how do you create one?
 Can you explain the difference between functional testing and non-functional testing? Provide
examples of each.
 How do you handle the challenge of testing in an agile development environment?
Yes
 What tools and technologies have you used for test automation? Share your experience and
the benefits you achieved.
Yes
 How do you ensure effective collaboration and communication with developers and other
stakeholders during the testing process?
Regular meeting, clear documentation, use collaboration tools teams, outlook.
 Describe a situation where you faced a difficult defect or quality issue. How did you approach
it, and what was the outcome?
 How do you stay updated with the latest trends and advancements in quality engineering and
software testing?
 How do you handle and prioritize multiple testing tasks and deadlines?
 Can you provide an example of how you have improved the overall quality or testing process
in a previous role?
 How do you handle situations where requirements are incomplete or unclear?
If I get any confusion or unclear I will discuss in a scrum call. To highlight my issue with the
team members. So SM,PO,Dev aware of issue. If possible I will schedule a call SM,PO,DEV to
resolve my issue
 How will you be an asset to the team?
 Why are you looking for a change?
As my experience looking for new role and challenges it will helps to maintain career growth
 How soon can you join?
My current organization official Notice period is 60 days. I will join with in 60days
 Suppose we give manual testing for six months or one year; what will you do?

 How interested are you in learning new technologies?


I'm absolutely open to working with new technologies. Technology is constantly changing and
improving the way we work, so I think it's really important to maintain a growth mindset and a
willingness to learn new tools that can make us more efficient and improve our quality of work.
 Failures in your work life.
 As Lead, how do you define the quality of the product before release?
 Suppose you are the lead QA and one new member join your team, and at the same time, you
have a deadline to meet in the next 2 or 3 days. How will you involve that new member in the
team so that you can utilize him/her to meet deadlines?
 As a QA, where do you see yourself after three years?
 What are your strengths and Weakness?
 What best practices have you learned, and how much difference does it make in your testing
career? Explain before and after situations.
 After you have run a full regression test and found new regression bugs, which bugs would you
prioritize? Bugs that suggest that functionality has regressed, or bugs that appear in new
features?
34
Can you work under pressure?
Absolutely. In my Current role, we faced tight deadlines to accept the build due to various reasons. We had to release the product in
the early stage. This experience taught me the importance of effective time management and maintaining a positive attitude under
pressure. I believe challenges present opportunities for growth, and I'm confident in my ability to handle the demands of this role.

What are some of your strengths and weaknesses?


My Strength is that I’m adaptable to new work environment, Flexible, Always completed task onetime.
I can only concentrate one task at a time. I also can’t say no .to everybody who ask for aid.

When was Accenture founded? And What do you know about Accenture?
Accenture was founded on January 1, 1989. It is a multinational professional services..Accenture operates in various industries,
offering innovative solutions to clients globally. 9K+ clients collaborate with Accenture. Recent 2024 financial profit goes +3 billion
dollars.

Tell us something about your achievements.


In my previous role, I started automating mobile browser-based applications. So we started implementing the framework, then
automated 30 cases later. We implemented integration testing using Ranorex, which will support desktop, mobile, and web
automation simultaneously. We delivered within a short period of time. We received recognition for the team contribution gold
award.

Why did you leave your last job?


I’d like to learn more and ready to take more Responsibility and challenges for professional growth. I believe that stepping out of my
comfort zone and looking new role to boost my career growth

Are you satisfied with your career now?


I’m happy with what I’m doing but not satisfied completely. I want to grow and explore more

What did you like the most about your previous job?
I appreciated about my previous job was the collaborative work environment. The team spirit and open communication fostered a
positive atmosphere, allowing us to collectively overcome challenges and achieve our goals.

Why are you interested in this position?


I’m excited about the position at your company. I have a 3+ years experience in Automation testing with different applications web,
API, Mobile. As per my experience and career matching with the job. I'm eager to be part of a team that shares my passion for QA

Where do you see yourself in next 5 years?


In the next 5 years, I envision myself in a senior role, leveraging my skills and experiences to contribute significantly to the success
of the team and the organization.

What are your long-term career goals?


My long-term career goal is to continue growing as a professional, taking on increasing responsibilities and eventually reaching a
team lead position.

What will be your ways to deal with work pressure?


I manage work pressure by prioritizing tasks, breaking them into manageable steps, and maintaining clear communication with my
team. Additionally, I believe in taking short breaks, practicing mindfulness, and seeking support when needed to maintain a healthy
work-life balance.

Will you be able to relocate anytime?


Yes, I am open to relocation. I understand the importance of adaptability in today's professional.

What kind of work environment do you expect while working?


I thrive in a collaborative and dynamic work environment where creativity is valued
Open communication
Recognizes achievements
Opportunities for continuous learning.

How would you make that situation work when your team is not performing to your expectations?
In such a scenario, I would initiate open communication with team members to understand their challenges, provide support, and
collaborate on solutions.
Tell me about your time management skills.
I prioritize tasks based on urgency and importance, creating a daily schedule that allows me to focus on key deliverables. I leverage
tools like calendars and to-do lists to stay organized. Additionally, I am adaptable and can adjust priorities when unexpected
challenges arise, ensuring that deadlines are consistently met

What problems did you face in your last role?

Ever missed a dead line?


Once in a while there are projects that are missing the deadline. Identify the bottleneck for the reason for delaying
Next step to resolve the issue parallel to communicate to the PO

Ever helped a teammate technically?


Yes in a team we can help & support to each other.
First thing that I can think training all new joiners. Both technically and functionally
Sometimes they failed to write script, some other issues I will suggest to do some other ways.
1. Smoke testing comes into the picture at the time of receiving
software build from development team.
2. The purpose of smoke testing is determining the build id testable
or not
3. Testing a basic and critical functionality before starting actual
testing

1. Sanity testing is used to check whether the bugs have been fixed
latest build or not.
2. Sanity testing is performed to make sure that all the defects have
been solved and no added issues come into the modification

1. Regression testing is also known as block box testing.


2. Regression testing is a type of software testing test cases are Re-
executed to check the previous functionality of application working
fine and there is no new changes affect existing functionality
System testing
Unit testing
Integration testing

White box testing done by developers. It is the testing of each and


every line of code in the program
1. Path testing
2. Condition testing
3. Loop testing
4. Response Time / Speed /Performance of program
DML – CREATE, ALTER, DROP, TRUNCATE, RENAME

CREATE TABLE TABLE_NAME CREATE TABLE Customers


{
{ Sid varchar(10) primarykey
}
Attribute1 Datatype1 Constrains
}
Alter it is DML command which is used to alter the table
1. Add a column
2. Modify a column
3. Rename a column
4. Drop a column

Alter TABLE Table_Name


1. ADD Column Name Data Type
2. RENAME COLUMN Old_Column to New Column
3. MODIFY COLUMN CN DT
4. DROP COLUMN CN;

DROP
DROP TABLE TABLE_NAME;
Certainly in my previous role, I faced one challenge to complete test
execution 3 cycles within 10 days and also looking pass percentage
high. But somehow all the cases are failed due to new build &
development. So we divided all 1500 cases based on member’s
availability. We trigger Jenkins auto jobs and assign those jobs to
particular members. We conducted brainstorm solutions meetings
and interact every day for open communication. We not only met the deadline
but also improved team dynamics

I was seeking new challenges & role that aligned for better career
growth

||Selenium Interview questions for 3-5 years experience ||

1. What is the advantage of selenium Web driver?


2. What is the difference between find Element and find Elements in selenium?
3. How do you locate elements on a web page using Selenium Web Driver?
4. What are the different types of locators supported by Selenium Web Driver?
5. How do you handle dynamic elements on a web page in Selenium?
6. What is the importance of implicit and explicit waits in Selenium Web Driver?
7. How do you handle multiple windows and frames using Selenium Web Driver?
8. Explain the concept of TestNG and how it is used with Selenium for test automation?
9. How do you perform mouse and keyboard actions using Selenium Web Driver?
10. What are the advantages and limitations of Selenium for test automation?
11. How do you handle SSL certificates and security-related issues in Selenium?
12. Can you automate testing for mobile applications using Selenium? If yes, how?
13. How do you manage test data and test configurations in Selenium tests?
14. What is Page Object Model (POM), and why is it used in Selenium automation?
15. How do you handle exceptions and errors in Selenium Web Driver scripts?
16. How to take screenshot in selenium?
17. Data provider in the TESTNG?
18. How to validate links are valid or not on the webpage?
19. How you manage drag and drop activity in selenium?
20. what is the use of testng.xml file?
1. How to avoid Stale Element Reference Exception?

2. Difference between XPath and CSS Selector?

3. XPath for Dynamic Element with Fixed and Changing Parts?


- Consider: <input type ='text' name ='user123'/>
- Given: The value 'user' is fixed, while the last 4 digits change frequently.

4. Handling Multiple Windows in Selenium:


i. Identify the number of windows opened.
ii. Move to a child window based on a specific page title condition.
iii. Verify expected page titles among child windows and navigate accordingly.

5. Page Factory vs. Page Object: Differences?

6. Downloading Files in Selenium: How?

7. Uploading Files in Selenium Web Driver: How?

|| BDD Cucumber Interview Questions||

Here are some common interview questions you might encounter when discussing Gherkin:

1. What is Gherkin, and what is its primary purpose?


- Gherkin is a language used to write executable specifications in a human-readable format. Its primary purpose is to define the
behavior of a software application in a way that non-technical stakeholders can understand.

2. What are the key components of a Gherkin file?


- Gherkin files typically consist of feature, scenario, scenario outline, Given-When-Then steps, and tags.

3. Explain the structure of a Gherkin scenario.


- A Gherkin scenario consists of three parts: Given, When, and Then. "Given" sets up the initial state, "When" describes the action
taken, and "Then" specifies the expected outcome or result.

4. What is the purpose of tags in Gherkin?


- Tags are used to label scenarios or features, making it easier to organize and filter them. They can be used for various purposes,
such as grouping related scenarios or marking scenarios for specific test runs.

5. What are scenario outlines, and when do you use them?


- Scenario outlines are used when you have a scenario that follows a similar structure but with different input values. They are a way
to create data-driven tests in Gherkin.

6. Explain the difference between "Background" and "Scenario" in Gherkin.


- "Background" is used to define steps that are common to all scenarios in a feature file, while "Scenario" is used to define a specific
test case or scenario.

7. How do you write comments in a Gherkin file?


- Comments in Gherkin are written with the "#" symbol at the beginning of a line.

8. What are the best practices for writing effective Gherkin scenarios?
- Some best practices include using clear and concise language, avoiding technical details, and focusing on the behavior being
tested. Scenarios should be independent and not rely on the order of execution.

9. Explain how Gherkin scenarios are transformed into executable tests.


- Gherkin scenarios are typically associated with a test automation framework like Cucumber, which provides step definitions that
map Gherkin steps to actual code. These step definitions are implemented to execute the tests.

1. Reverse a String:
Write a Java program to reverse a given string.
2. Find the Largest Element in an Array:
Find and print the largest element in an array.
3. Check for Palindrome:
Determine if a given string is a palindrome (reads the same backward as forward).
4. Factorial Calculation:
Write a function to calculate the factorial of a number.
5. Fibonacci Series:
Generate the first n numbers in the Fibonacci sequence.
6. Check for Prime Number:
Write a program to check if a given number is prime.
7. String Anagrams:
Determine if two strings are anagrams of each other.

8. Array Sorting:
Implement sorting algorithms like bubble sort, merge sort, or quicksort.

9. Binary Search:
Implement a binary search algorithm to find an element in a sorted array.

10. Duplicate Elements in an Array:


Find and print duplicate elements in an array.

11. Linked List Reversal:


Reverse a singly-linked list.

12. Matrix Operations:


Perform matrix operations like addition, multiplication, or transpose.

13. Implement a Stack:


Create a stack data structure and implement basic operations (push, pop).

14. Implement a Queue:


Create a queue data structure and implement basic operations (enqueue, dequeue).

15. Inheritance and Polymorphism:


Implement a class hierarchy with inheritance and demonstrate polymorphism.

16. Exception Handling:


Write code that demonstrates the use of try-catch blocks to handle exceptions.
17. File I/O:
Read from and write to a file using Java's file I/O capabilities.
18. Multithreading:
Create a simple multithreaded program and demonstrate thread synchronization.
19. Lambda Expressions:
Use lambda expressions to implement functional interfaces.
20. Recursive Algorithms:
Solve a problem using recursion, such as computing the factorial or Fibonacci sequence.

1 Reverse each word in a sentence:


Input: "my name is Pratima"
Output: "ym eman si amitarP"

2 Reverse the entire sentence:


Input: "my name is Pratima"
Output: "Pratima is name my"

3 Find the 3rd largest number in an array:


Array: {1, 99, 4, 6, 10, 100, 101, 5, 77, 66}
Output: 99

4 Binary Search Implementation:


Write a Java program to perform binary search on a sorted array to find a specific element.

5 Duplicate Elements in an Array:


Write a Java program to find and print duplicate elements in an array.

1 Finding Common Elements in Arrays:


Integer[] a1 = {1,2,3,2,1};
Integer[] a2 = {1,2,3};
Integer[] a3 = {1,2,3,4};
// Output: {1,2,3}

2Second Largest and Second Smallest Numbers:


// Code to find second largest and second smallest numbers in an array

3 Finding 3rd Largest Element (Using Bubble Sort):


// Bubble Sort algorithm to find the 3rd largest element in an array

4 Printing a Pattern:
// Code to print the pattern

*
**
***
****
*****
5 Finding Word Occurrences:
String str ="I am Java developer I am proud of it";
// Output: Java: 1, proud: 1, of: 1, I: 2, developer: 1, it: 1, am: 2

6 Character Occurrences in String:


// Code to find occurrences of each character in a given string
// Input: Pratima
// Output: P: 1, r: 1, a: 2, t: 1, i: 1, m: 1

7 Code for Overriding and Overloading:


// Explanation and demonstration of method overriding and overloading

8 Finding Max and Min from an Array:


// Code to find the maximum and minimum values in an array

9 Average of Prime Numbers in a Range:


// Code to find the average of all prime numbers in a given range

1. Basic SQL Queries:


- Fetch all columns from a table:
- SELECT * FROM table_name;
- Get distinct values from a column:
- SELECT DISTINCT column_name FROM table_name;
- Retrieve top N records from a table:
- SELECT * FROM table_name LIMIT N;

2. Filtering and Sorting:


- Filter rows where a column equals a value:
- SELECT * FROM table_name WHERE column_name = value;
- Filter rows within a range:
- SELECT * FROM table_name WHERE column_name BETWEEN value1 AND value2;
- Retrieve rows with NULL values in a column:
- SELECT * FROM table_name WHERE column_name IS NULL;
- Sort result set in ascending/descending order:
- SELECT * FROM table_name ORDER BY column_name ASC/DESC;

3. Aggregate Functions:
- Count total rows:
- SELECT COUNT(*) FROM table_name;
- Calculate average, sum, min, max:
- SELECT AVG(column_name), SUM(column_name), MIN(column_name), MAX(column_name) FROM table_name;
- Group and calculate aggregates:
- SELECT column_name, AVG(salary) FROM table_name GROUP BY column_name;

4. Joins:
- INNER, LEFT, RIGHT, FULL joins explained:
- INNER: Retrieve common rows from both tables.
- LEFT: All rows from the left table and matching rows from the right.
- RIGHT: All rows from the right table and matching from the left.
- FULL: All rows from both tables.
- Retrieve data from multiple tables:
- SELECT * FROM table1 JOIN table2 ON table1.column_name = table2.column_name;

5. Subqueries:
- Using a subquery to retrieve data:
- SELECT * FROM table_name WHERE column_name IN (SELECT column_name FROM another_table);
- Comparing values between tables:
- SELECT * FROM table1 WHERE column_name = (SELECT column_name FROM table2 WHERE condition);

6. Data Modification:
- Insert new record:
- INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
- Update records:
- UPDATE table_name SET column_name = new_value WHERE condition;
- Delete records:
- DELETE FROM table_name WHERE condition;

7. Table Design and Constraints:


- Primary key vs. Foreign key differences:
- Primary key uniquely identifies a record, while a foreign key links to another table's primary key.
- Design a table schema:
- Create table with appropriate columns, primary keys, and foreign keys.

8. Advanced Queries:
- Retrieve the nth highest (or lowest) value:
- SELECT column_name FROM table_name ORDER BY column_name DESC LIMIT n-1, 1;

|| Java Interview questions for SDET 3-5 years experience ||

What is memory leakage?


What is upcasting and downcasting in java?
Is collections homogeneous or heterogeneous?
Is tree set homogeneous or heterogeneous?
What is garbage collector?
Why string is immutable?
Can we write try block with finally block without catch block?
Difference between local variable and instance variable?
Can you execute code before the main method in Java?
leap year program
Programm for Only Mostly occur character count in a string
Difference between linked list and array list?
How to int to string and string to int?
Why we are using wrapper classes in java even though we have primitive data types?
Can we override static method?
Method overload and method overriding which is best?

Java collection is a formwork that provides an architecture to store and manipulate the group of objects.

Java collection can achieve all operations that provide on data such as searching, sorting, insertion, manipulation, and deletion.

In Java collections provides many Interfaces

1. Set

2. List

3 . Deque

4. Queue

In Each Interfaces provides many classes


Mobile Testing
1. Gestures are mainly classified into

1. clickGesture
2. doubleClickGesture
3. longClickGesture
4. dragGesture
5. fling Gesture
6. pinchOpenGesture
7. pinchCloseGesture
8. swipe Gesture
9. scroll Gesture

Click Gesture
JavaScriptExecutor js = (JavaScriptExecutor) driver;
Js.executeScript("mobile: ClickGesture", ImmutableMap.of(

"elementId", ((RemoteWebElement) element).getId()

));

Different types of Locators in Mobile

1. Accessibility id

2.id, xpath

Major Bugs

Minor Bugs

Critical Bugs

Blocker Bugs

Unit Testing

Mobile App Testing

What are the different ways to achieve abstraction?


In java abstraction can be achieved in 2 ways
by using Abstraction Class to achieve 0 to 100%
by using Interface to achieve 100% abstraction

What is abstraction in java?


Abstraction is a process of hiding the internal implementation logic and just
showing functionality to the user.

What is data hiding in java?


Hiding the data members of a class from outside the class is known as data
hiding.
Data Hiding can be achieved by using private access modifier
In OOPS our first priority will be data rather than method we will not allow
directly data to system
using Getter & Setter method to access the data

to improve security of the program


to protect data from being accidentally modified or corrupted
What are getters () & Setters () methods which are used in Encapsulation?
In java getters() & setters() are methods that allow to access and modify data
from being displayed private fields of class.
They are also known as accessor and mutator.

Getters are used to get & read data from being displayed from class.
Setters are used to set & write data from being displayed from class.

Define Encapsulation? How encapsulation achieved in java?


Encapsulation is a process of binding the data members and methods tougher
into a single entity.
A class is an encapsulation of data members and methods.
A package is an encapsulation of class and interfaces

by this way clearly say that encapsulation will be used to achieve Security
1. Declare all the data members of a class as private
2. Provide getters & Setters methods to access and modify private data members
3. Design only no argument constructor in the class

Explain method shadowing and variable shadowing?

Why operator overloading not allowed in java?

Explain static method dispatch & dynamic method dispatch?

Explain difference between compile time polymorphism & Run time


polymorphism?

Compile time polymorphism happens before execution of program


Compile time polymorphism is also known as static polymorphism is achieved
through method overloading.
Compile time polymorphism provides fast execution
Inheritance is not required to achieve compile time polymorphism

Run time polymorphism happens at the time of execution of program run time
Run time polymorphism is also known as dynamic polymorphism is achieved
through Method overriding
Run time polymorphism provides slow execution
Inheritance is required to achieve Run time polymorphism
What are the different ways to achieve run time polymorphism?
The different ways to achieve run time polymorphism.
1. Method overriding
2. Upcasting

What are the different ways to achieve Compile time polymorphism?


The different ways to achieve compile time polymorphism.
1. Method overloading
2. Constructor overloading
3. Operator overloading [Not allowed in java]

What are the different ways to achieve polymorphism in java?


1. Compile time polymorphism
2.Run time polymorphism

What is polymorphism?
Polymorphism is a Greek word. Poly means many & morphism means forms.
Polymorphism means the ability to get multiple forms is known as polymorphism
1. Code reusability
2.Flexibility
3.Maintainability

Can we override constructor of a class in java?


No we can’t override constructor of a class in java.
if u try to override a constructor in java you will get compile time error.

Which method of parent class can’t be overridden from child class?


Static method and final method can’t be overridden by a child class.

Can we override the main method in java? Why?


No we cannot override the main method in java.
Because main method is a static method and static method cannot be overridden

What is the benefit of method overloading?


We can achieve polymorphism
Code Reusability
Less code
Standard interface

When to go for method overriding? Give some example.


When a sub class wants to provide specific implementation method that is already
provided in super class.
1. Sub class customization.
Can we override a static method in java?
No we can’t override static method in java
static means constant once declared we can’t change the value
static members belongs to the class and it will load at the time of class loading
Method overriding is applicable non-static methods

What is method overriding in java?


if we want to change the task itself then we will go with overriding
it is a process of changing the implementation of super class method into the sub
class
Is-A relationship is required
Private and final methods can’t be overridden
Example of Run time poly

What is implicit and explicit type casting?


Why we need to perform downcasting?
Why we need to perform upcasting?
What is the use of upcasting & downcasting?

Explain upcasting & downcasting in java?


The process of converting lower level data type to higher level data type is known
as upcasting.
The process of converting higher level data type to lower level data type is known
as downcasting.

What is non-primitive type casting in java?

Does a constructor of parent class is inherited by child class? Why?

Which type of members from parent class not inherited by child class in java?
Private members are accessible only within the class in which they declared.
Outside class
private members is not visible not accessible

Constructor are not inherited by child class

Why this() and super() can’t be used in a constructor together?


this() and super() keywords are both used to call constructors in java.
the this() keyword is used to call another constructor in the same class.
super() keyword used to call the constructor of parent class.

Both this() and super() are the constructor call and they need to be first
statement of constructor. So if they used together then one will be 1st statement
and other 2nd statement which will lead compile time error

Explain the difference between this() & super() statement?

What is the difference between this and super keyword in java?

Explain super keyword in java?


It is a keyword used to refer super class properties from the sub class.
Super keyword must be used inside non-static method and constructor. But can’t
be used inside static block.

Explain this keyword in java?


it is a keyword used to refer current object
an object through which we are invoking a method is known as current object
this keyword will refer only one object at a time.
We need to use this keyword explicitly when local variable and non-static variable
both are same.
We can use inside constructor or non-static block. But can’t be used inside static
block.

What is diamond problem? How to resolve it in java?


The diamond problem in java occurs when a super class inherits more than two
sub class.
This can lead to ambiguity in method resolution. As compiler don’t know which
method we need to call to implement sub class.
We can avoid diamond problem using Interfaces {Implements}

Why java doesn’t support multiple inheritances in java?


Java doesn’t support multiple inheritances because super class inherit more than
two sub class.
it can lead to ambiguity to method resolution so compiler don’t known which
method we need to call to implement in sub class
it will throw diamond problem.

What is inheritance?

Deriving the property from one class to another class is known as inheritance.
The class from where the properties are inherited is known as “SUPER CLASS”.
Also known as base class
the class to which properties are inherited is known as “SUB CLASS”. Also known
as derived class

We can use IS-A relationship between two classes by using Extend keyword

1. Single level Inheritance


2. Multiple Inheritance
3. Multi level Inheritance
4. Hybrid Inheritance
5. Hierarchical Inheritance

How many classes can be extended by one class in java?


A class in java can extend only one other class. because it will avoid complexity
and ambiguity associated with multiple inheritance.

What is an interface?
It is a java definition block which is used to data members and methods.
Data members are by default static and final.
Data methods are by default public and abstract.

What is mean by abstract class?


A class can be declared by using abstract keyword is known as abstract class

What is mean by abstract method?


A method can be declared without definition is known as abstract method.

Constructor
it is a special member function of class. which will have same name as that of
class name.
Constructor is used to initialize object.
Constructor will be called automatically at the time of object creation
constructor doesn’t have any return type.
Constructors are mainly classified into 2 type
1. User defined Constructor
2. Default constructor

Why String is Immutable?


When a string object is referred by multiple references by using one reference. If
we try to change the content that should not affect other references. This is
possible only when object is immutable.

Throws
1. It is a keyword used to inform caller about checked exception
2. Throws keyword should be used in the method definition
3. Using throws keyword we can inform multiple checked exception.
Throw
1. It is a keyword used to throw both checked and unchecked exception.
2. Throw keyword must called method declaration.
3.Throw keyword will throw one exception

What is Exception Propagation?

Diff between Throw & Throws Keyword?

How to get Browser Name : using javaScript return navigator.appCodeName

You might also like