Interview Series
Interview Series
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
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
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
12. How to write code for executing a single test case multiple times?
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 ==
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
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
Wait.untill(ExpectedCondition.visibleofText());
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
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
6) What is interface?
7) OOPS Concepts
!!!!
8) What is difference between interface and abstract class?
9) Exception handling
!!!
10) how to reverse the words in the string?eg: i like program language java ?
In Java Interface have certain restriction to use access modifier. Support Static ,final &
public access modifier in java
public static final int MY_CONSTANT = 42; private static final int
MY_CONSTANT = 42;
Public: Scope: public members can be accessible with in package & outside package
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.
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.
Yes. In java Main method can be overloaded. Overloading refers to the multiple
methods in same class with the same name but different signature.
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.
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
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
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
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?
TestNG Questions
3. What is a TestNG framework? what are the features of the TestNG framework?
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?
10. what is @dataProvider annotation? what is the return type of this annotation?
13. What are the annotations in TestNG and it�s the sequence
14. Difference between JUnit and TestNG
17. If we wanna do data-driven with testng what are all annotations required?
22. What is the listener in TestNG? List those listeners which you used in your company?
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:
• 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?
29. Xpath for Change column (with Tata Steel) -> (//a[text()='Tata Steel']//parent::td)//following::td[2]
31. How can I check whether Tata steel is there in 1st column or not?
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.
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
// MY_CONSTANT = 21;
!
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
!
10 .What are the two different files used in Cucumber?
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
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
IJavaScriptExecutor executor =
Executor.executeScript(arguments[0].removeAttribute(“disabled”),web);
web.click();
Passing test data in Selenium
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
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 ?
// Handle ExceptionType1
// Handle ExceptionType2
// Handle ExceptionType3
} // ... and so on
Selenium :
TestNG
BDD:
Manual Testing :
how you will create the job and how it will execute ?
What is OOPS?
What is an object?
What is Constructor?
Single Inheritance
This type of inheritance will have single sub class &
super class
One Sub class & one Super
class
Multi Level Inheritance:
Multiple Inheritances
Hierarchical Inheritance
This type of inheritance one super will be extended
more than one sub class.
Hybrid Inheritance
Converting High level data type to Low level data type. Is known as Downcasting
Child c = new child(p)
MAM
If(charArray[i] != charArray[name.length-1-i]
SelectByValue
SelectByIndex
SelectByVisibleText
What is Serialization ?
There are 2 popular 3rd party Libraries that can achieve serialization. JACKSON
& GSON
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
Printing Pattern
Creating Object
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
What is System.out.println(); ?
5. JavaScript Exception
We get this kind of exception in selenium. When we pass
JavaScript statement having syntax issues.
@Test (Invocationcount=10)
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
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
Default Methods
Default methods are methods that have a default implementation
defined with in interface.
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
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.
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.
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.
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
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
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
Here are some common interview questions you might encounter when discussing Gherkin:
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.
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.
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
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;
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 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.
1. Set
2. List
3 . Deque
4. Queue
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(
));
1. Accessibility id
2.id, xpath
Major Bugs
Minor Bugs
Critical Bugs
Blocker Bugs
Unit Testing
Getters are used to get & read data from being displayed from class.
Setters are used to set & write data from being displayed from class.
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
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 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
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
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
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
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.
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
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