Tech Mahindra
10+ TCS Interview Questions and Answers
Q1. What is Select class in Selenium. Write down syntax and explain the methods
Select class in Selenium is used to handle dropdowns and multi-select options on a web page.
Syntax: Select select = new Select(driver.findElement(By.id("dropdownId")));
Methods: selectByVisibleText(), selectByValue(), selectByIndex(), getOptions(), isMultiple(), getAllSelectedOptions(), deselectAll(), deselectByVisibleText(), deselectByValue(), deselectByIndex()
Select class is used to handle dropdowns and multi-select options on a web page.
It provides various methods to select...read more
Q2. What is polymorphism and explain with examples you used in your project
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as if they were the same type.
Polymorphism is achieved through method overriding and method overloading
Example: A parent class Animal has a method called makeSound(). Child classes like Dog, Cat, and Cow can override this method to make their own unique sound.
Another example is method overloading where a class can have multiple methods with the same name but di...read more
Q3. How to point to any other branch other than master in Jenkins
To point to any other branch in Jenkins, use the 'Branch specifier' field in the 'Source Code Management' section.
In the Jenkins job configuration, go to the 'Source Code Management' section
Select the appropriate SCM tool (e.g. Git, SVN)
In the 'Branch specifier' field, enter the name of the branch you want to point to (e.g. 'develop', 'feature/xyz')
Save the configuration and run the job
Q4. Write SQL query to get the 10th highest salary from employee table
SQL query to get the 10th highest salary from employee table
Use ORDER BY and LIMIT clauses
Subquery can be used to get the 10th highest salary
Q5. What is abstraction and difference between interface and abstract class
Abstraction is a way of hiding implementation details. An interface is a contract that specifies the behavior of a class.
Abstraction is achieved through abstract classes and interfaces
Abstract classes can have both abstract and non-abstract methods
Interfaces can only have abstract methods and constants
A class can implement multiple interfaces but can only inherit from one abstract class
Abstract classes can have constructors but interfaces cannot
Example: An abstract class 'Ani...read more
Q6. What is the design pattern used in my framework
I don't have the available data to answer this question.
N/A
Q7. What is Maven and explain it's structure
Maven is a build automation tool used primarily for Java projects.
Maven uses a Project Object Model (POM) to manage dependencies and build process
It uses a central repository to download dependencies
Maven has a defined directory structure for projects
Plugins can be added to extend Maven's functionality
Q8. Explain your framework in detail
My framework is a hybrid framework that combines data-driven and keyword-driven approaches.
The framework uses Excel sheets to store test data and keywords.
It uses Selenium WebDriver for browser automation.
It has a modular structure with reusable functions and libraries.
It generates detailed HTML reports for test results.
It supports parallel execution of tests.
It has built-in exception handling and logging mechanisms.
Q9. What is Robot framework? Challenges faced during testing? Types of Testing. How to handle bugs? Whether you will be able to work for extra hours during prod releases?
Robot Framework is a generic open-source automation framework for acceptance testing and acceptance test-driven development (ATDD).
Robot Framework is a keyword-driven test automation framework that uses tabular test data syntax.
Challenges faced during testing include identifying and prioritizing test cases, handling dynamic elements, and maintaining test scripts.
Types of testing include functional testing, regression testing, performance testing, and security testing.
Handling...read more
Q10. Write SQL query to delete duplicate records
SQL query to delete duplicate records
Use the DELETE statement with a subquery to identify and delete duplicate records
The subquery should select the duplicate records based on the columns that define uniqueness
Use the ROW_NUMBER() function to assign a unique number to each row, and delete rows with a number greater than 1
Q11. How to link TestNG file in Maven POM
To link TestNG file in Maven POM, add the TestNG dependency and plugin in POM.xml
Add TestNG dependency in POM.xml
Add TestNG plugin in POM.xml
Configure TestNG plugin to run the TestNG XML file
Example:
org.testng testng 7.4.0 org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5 testng.xml
Q12. What is setting.xml in Maven
settings.xml is a configuration file used by Maven to customize its behavior.
It contains information about the local repository location, proxy settings, and server credentials.
It can be used to define profiles for different environments.
It is located in the .m2 directory in the user's home directory.
It can be overridden by using the -s or --settings command-line option.
Q13. 1. Explain your project. 2. Explain Oops concept
I have worked on a project to automate testing processes using various tools and frameworks.
Implemented automation scripts using Selenium WebDriver for web application testing
Utilized TestNG framework for test case management and execution
Integrated Jenkins for continuous integration and deployment
Used Page Object Model design pattern for better code maintenance
Performed API testing using tools like Postman
Q14. What is sprint retrospective
Sprint retrospective is a meeting held at the end of a sprint to review the team's performance and identify areas for improvement.
It is a time-boxed meeting
It is attended by the entire team including the product owner and scrum master
The team discusses what went well, what didn't go well, and what can be improved in the next sprint
Action items are identified and assigned to team members for follow-up
The goal is to continuously improve the team's processes and performance
Q15. what is sprint backlog
Sprint backlog is a prioritized list of tasks to be completed during a sprint.
It is created during sprint planning
It contains user stories, bugs, and technical tasks
It is updated daily during the sprint
It helps the team to stay focused on the sprint goal
It is owned by the development team
Q16. reverse string java program
Reverse a string in Java using StringBuilder or iterative approach.
Use StringBuilder's reverse() method to reverse the string.
Iterate through the string from end to start and build the reversed string.
Handle null or empty string cases.
Example: input 'hello' -> output 'olleh'
Interview Process at TCS
Top Automation Test Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month