Mphasis
10+ New Manasa Mata Foods Interview Questions and Answers
Q1. Can you create a Static method inside an Abstract class or Interface?
Yes, you can create a static method inside an abstract class or interface.
Static methods can be defined in interfaces since Java 8.
Static methods in interfaces are used for providing utility methods that are not tied to any specific instance of the interface.
Static methods in abstract classes can be used for common functionality that does not require an instance of the class.
Q2. Can you create a Static local variable inside a Static method
Yes, a static local variable can be created inside a static method.
Yes, a static local variable can be declared inside a static method in programming languages like C++.
Static local variables retain their values between function calls.
Example: static void myStaticMethod() { static int count = 0; count++; }
Q3. What is the memory allocation for a String?
String memory allocation is dynamic and depends on the length of the string.
String memory allocation is dynamic and can change based on the length of the string.
In Java, a String object is stored in the heap memory.
Each character in a String typically takes up 2 bytes of memory.
String objects in Java are immutable, meaning once a String object is created, it cannot be changed.
Q4. 1.Difference between findElement and findElements. 2. What is interface?
Explaining the difference between findElement and findElements and defining interface.
findElement returns the first matching element on the page while findElements returns a list of all matching elements.
Both methods are used to locate web elements on a page using locators such as ID, class name, name, etc.
An interface is a collection of abstract methods that can be implemented by a class. It defines a contract that the implementing class must follow.
In Java, interfaces are u...read more
Q5. What is a constructor and it's purpose?
A constructor is a special type of method in a class that is automatically called when an object of that class is created.
Constructors have the same name as the class they belong to
They are used to initialize the object's state or perform any necessary setup
Constructors can have parameters to customize the initialization process
Example: public class Car { public Car(String color) { this.color = color; } }
Q6. Can you override a Static Method?
Yes, a static method can be overridden in Java using the concept of method hiding.
In Java, static methods cannot be overridden in the traditional sense like instance methods.
When a subclass defines a static method with the same signature as a static method in the superclass, it is called method hiding.
Method hiding does not follow polymorphism and is resolved at compile time based on the reference type.
Example: class Parent { static void display() { System.out.println("Parent...read more
Q7. What is the Parent class of Java?
The parent class of Java is the Object class.
All classes in Java are directly or indirectly derived from the Object class.
The Object class is the root class in Java's class hierarchy.
It provides methods that are common to all objects in Java, such as toString(), equals(), and hashCode().
Q8. What is Window Handles in Selenium?
Window Handles in Selenium are unique identifiers used to handle multiple browser windows in a Selenium test script.
Window Handles are unique alphanumeric strings assigned to each browser window opened by Selenium.
They are used to switch between different browser windows during a test script execution.
Window Handles can be obtained using getWindowHandles() method in Selenium.
Example: Set
handles = driver.getWindowHandles();
Q9. write the code in notepad by sharing your screen
Code writing task for Automation Test Engineer position
Open Notepad
Write code for the given task
Share screen to show the code
Ensure code is well-structured and follows best practices
Q10. code to find second largest number in array without sorting
Use two variables to keep track of the largest and second largest numbers in the array.
Iterate through the array and compare each element with the largest and second largest variables.
Update the variables accordingly to find the second largest number.
Return the second largest number once the iteration is complete.
Q11. What do you mean by BrowserContext in Playwright
BrowserContext in Playwright refers to an isolated environment for running tests in a browser.
BrowserContext allows for separate cookies, local storage, and caches for each context
It can be used to simulate multiple users interacting with a website simultaneously
Contexts can be created and closed as needed during test execution
Q12. Code to Reverse a string
Code to reverse a string
Create an empty string variable to store the reversed string
Loop through the original string from the end to the beginning
Add each character to the empty string variable
Return the reversed string
Q13. explain your automation framework
My automation framework is a hybrid framework that uses both data-driven and keyword-driven approaches.
The framework is built using Selenium WebDriver and TestNG.
It uses Excel sheets to store test data and Apache POI library to read/write data from/to Excel.
The framework has a modular structure with reusable functions and libraries.
It uses Page Object Model design pattern to maintain object repository.
The framework generates detailed HTML reports using ExtentReports library.
I...read more
Q14. find xpath of product on amazon
The xpath of a product on Amazon can be found by inspecting the HTML code of the product page.
Right click on the product on Amazon and select 'Inspect' to view the HTML code
Locate the unique identifier of the product, such as class name or id
Construct the xpath using the unique identifier and other relevant attributes
Q15. Palindrome code in java
Palindrome code in Java
A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward
To check if a string is a palindrome, we can compare the first and last characters, then the second and second-to-last characters, and so on
We can use a loop to iterate through the string and compare the characters
We can also use StringBuilder to reverse the string and compare it to the original string
Q16. Explain project framework
Project framework is a structure that provides guidelines, best practices, and tools for developing and maintaining software projects.
Project framework defines the overall structure of the project, including directories, files, and naming conventions.
It includes guidelines for coding standards, testing procedures, and documentation requirements.
Frameworks like Selenium, TestNG, and JUnit provide tools and libraries for automation testing projects.
Frameworks help in organizing...read more
Q17. Explain Framework
A framework is a set of guidelines, tools, and libraries used to develop and maintain software applications.
Provides structure and guidelines for development
Promotes code reusability and maintainability
Includes libraries and tools for common tasks
Supports automation and scalability
Examples: Selenium WebDriver for web automation, TestNG for test execution
Q18. oops concept in java
Object-oriented programming concept in Java
Encapsulation: bundling data and methods that operate on the data
Inheritance: creating new classes using existing classes
Polymorphism: ability to present the same interface for different data types
Interview Process at New Manasa Mata Foods
Top Automation Test Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month