Infosys Interview Questions and Answers
Infosys Interview Questions and Answers
2. Do you know OOPS concepts and in framework where and how you have
implemented it?
Inheritance: Base test classes are inherited by test scripts for reusability.
Polymorphism: Method overloading is used for different argument variations in utility
methods, while overriding is used for WebDriver methods.
A top-level class cannot be private; only nested classes (inner classes) can be
declared private. This restricts their access to within the enclosing class.
4. What is the difference between == and equals?
equals: Compares the content or value of objects (overridden in classes like String).
5. How is a string immutable?
Strings are immutable because once created, their value cannot be changed. Any
modification creates a new string object, leaving the original unchanged.
6. Where do strings and their references get stored?
String literals are stored in the String Pool within the heap.
HashMap: Used for storing key-value pairs where keys are unique.
11. List declaration?
Set is used when we need to store unique elements, such as to remove duplicates
from a collection.
13. How to test the Flipkart cart scenario with quantity updates?
Use the formula Sum = n * (n + 1) / 2. Subtract the sum of displayed numbers from
this total to find the missing number.
15. Which collection to store all table data and why?
put(key, value): Returns the previous value associated with the key or null.
Overloading: Used in utility classes, like methods handling different data types.
Dynamic Data: Data-driven approach using Excel, databases, or APIs for real-world
scenarios.
23. How to resolve conflicts while pushing code in Git?