TCS
20+ Interview Questions and Answers
Q1. What are the different types of exception you have seen & how to handle it?
Different types of exceptions include checked, unchecked, runtime, and custom exceptions.
Checked exceptions are checked at compile time and must be handled using try-catch or throws keyword.
Unchecked exceptions are not checked at compile time and can be handled using try-catch or left unhandled.
Runtime exceptions are unchecked exceptions that occur at runtime, such as NullPointerException or ArrayIndexOutOfBoundsException.
Custom exceptions are user-defined exceptions that ext...read more
Q2. What are the challenges faced in automation?
Challenges in automation include complex test scenarios, maintenance of scripts, and compatibility issues.
Complex test scenarios require thorough planning and execution.
Maintenance of scripts is essential to keep them up-to-date with application changes.
Compatibility issues arise when automation tools do not support all technologies used in the application.
Q3. What you use to get elements from the drop down
To get elements from a drop down, I use Selenium WebDriver's Select class
Use Select class from Selenium WebDriver to interact with drop down elements
Identify the drop down element using its locator
Instantiate a Select object with the drop down element
Use Select object's methods like selectByVisibleText(), selectByValue(), selectByIndex() to choose an option
Q4. What the types of framework you have used
I have used various types of test automation frameworks including data-driven, keyword-driven, and behavior-driven frameworks.
Data-driven framework: Used to separate test data from test scripts, allowing for easier maintenance and scalability. Example: TestNG with Excel or CSV files.
Keyword-driven framework: Utilizes keywords to represent actions or operations, making test scripts more readable and reusable. Example: Robot Framework.
Behavior-driven framework: Focuses on defin...read more
Q5. Coding in Java to find second largest string in given string
Java code to find second largest string in an array of strings
Create an array of strings
Sort the array in descending order based on string length
Return the second element in the sorted array
Q6. Switch to child window from parent window, take text and input in another child window
Use window handles to switch to child window, extract text, and input in another child window
Use getWindowHandles() to get all window handles
Switch to child window using switchTo().window() method
Extract text from the first child window
Switch to another child window and input the extracted text
Q7. Use of the population optuon from Neo load?
Population option in Neo load is used to simulate realistic user behavior by generating virtual users based on real-world user data.
Population option allows for creating virtual users based on real-world user data
It helps in simulating realistic user behavior and load on the application
It can be used to generate virtual users based on demographics, location, behavior, etc.
This option is useful for load testing applications that have a large user base
Example: If an e-commerce ...read more
Q8. How do you push your code into github?
Pushing code to GitHub involves using Git commands to add, commit, and push changes to a remote repository.
Use 'git add .' to stage all changes
Use 'git commit -m 'Your commit message here'' to commit changes
Use 'git push origin master' to push changes to the master branch on GitHub
Q9. How do you read data from excel
To read data from Excel, use libraries like Apache POI or Openpyxl in Python.
Use libraries like Apache POI or Openpyxl in Python to read data from Excel files
Identify the Excel file and specify the sheet and cell from which to read data
Use appropriate methods provided by the library to extract data from the specified cell or range
Q10. What do you use for reporting?
I use a combination of tools such as Jira, TestRail, and Excel for reporting.
Jira for tracking bugs and issues
TestRail for test case management and execution results
Excel for creating customized reports and data analysis
Q11. What is work load model?
A work load model is a representation of the expected workload on a system or application.
It helps in identifying the resources required to handle the expected workload.
It can be used to simulate different scenarios and identify potential bottlenecks.
It can also help in capacity planning and optimization.
Examples include the number of users accessing a website, the amount of data processed by an application, or the frequency of transactions in a system.
Q12. What rendezvous point?
A rendezvous point is a synchronization point where two or more processes or threads meet to exchange information.
It is used in distributed systems to ensure that all processes start at the same time.
It is also used in load testing to simulate multiple users accessing a system simultaneously.
Examples include message queues, semaphores, and sockets.
It helps to avoid race conditions and deadlocks.
Q13. What is spike testing?
Spike testing is a type of performance testing that involves testing the system's ability to handle sudden and extreme spikes in traffic or load.
It is used to identify the breaking point of the system
It involves simulating sudden and extreme spikes in traffic or load
It helps in identifying performance bottlenecks and scalability issues
Examples include sudden increase in user traffic, sudden increase in database queries, sudden increase in file uploads/downloads
Q14. Array list and linked list difference?
Array list stores elements in contiguous memory locations, while linked list stores elements in nodes with pointers to the next node.
Array list allows random access to elements based on index, while linked list requires traversal from the beginning to access elements.
Insertions and deletions are faster in linked list as it only requires updating pointers, while in array list it may require shifting elements.
Array list has a fixed size, while linked list can dynamically grow o...read more
Q15. Are constructors non static?
Yes, constructors are non-static methods used to initialize objects of a class.
Constructors are special methods used to initialize objects of a class.
They are non-static, meaning they are called on an instance of the class.
Constructors have the same name as the class and do not have a return type.
Example: public class Test { public Test() { // constructor code } }
Q16. Is Select class or interface?
Select is a class in Selenium WebDriver.
Select is used for handling dropdowns in Selenium WebDriver.
It provides methods to select options by visible text, value, or index.
Example: Select dropdown = new Select(driver.findElement(By.id("dropdown")));
Example: dropdown.selectByVisibleText("Option 1");
Q17. Diff between array list and linked list
ArrayList is a resizable array implementation, LinkedList is a doubly linked list implementation.
ArrayList uses a dynamic array to store elements, LinkedList uses nodes with pointers to store elements.
ArrayList provides fast random access, LinkedList provides fast insertion and deletion.
Example: ArrayList
arrList = new ArrayList (); LinkedList linkedList = new LinkedList ();
Q18. Difference between assert and verify?
Assert is used to validate the expected result while verify is used to check the actual result without stopping the execution.
Assert is used to validate the expected result and if the assertion fails, the test is marked as failed and stops execution.
Verify is used to check the actual result against the expected result but does not stop the execution even if the verification fails.
Assert is commonly used for critical checkpoints in the test case while verify is used for non-cr...read more
Q19. What is garbage dump
A garbage dump is a place where waste materials are disposed of.
It is a site where garbage is collected and stored.
It can be a landfill or an incinerator.
It can cause environmental pollution and health hazards.
Recycling and proper waste management can reduce the need for garbage dumps.
Q20. Array an array list difference
Array is a fixed-size data structure while ArrayList is a dynamic-size data structure in Java.
Array is a fixed-size data structure in Java, while ArrayList is a dynamic-size data structure.
Arrays can hold primitive data types and objects, while ArrayList can only hold objects.
Arrays require a specified size during initialization, while ArrayList can dynamically resize itself.
Arrays use square brackets [] for declaration, while ArrayList uses the ArrayList class from the Java ...read more
Q21. Types of waits.
Types of waits include implicit, explicit, and fluent waits in test automation.
Implicit wait: Wait for a certain amount of time before throwing an exception.
Explicit wait: Wait for a certain condition to be met before proceeding.
Fluent wait: Wait for a condition with a defined maximum wait time and polling frequency.
Q22. Selenium 4 features
Selenium 4 features include improved relative locators, new grid architecture, and better support for Chrome DevTools Protocol.
Improved relative locators for more flexible element locating
New grid architecture for better scalability and performance
Better support for Chrome DevTools Protocol for enhanced debugging capabilities
More about working at TCS
Interview Process at null
Top Senior Test Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month