Add office photos
Engaged Employer

Tech Mahindra

3.5
based on 34.3k Reviews
Filter interviews by

10+ TCS Interview Questions and Answers

Updated 21 May 2024
Popular Designations

Q1. What is Select class in Selenium. Write down syntax and explain the methods

Ans.

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

View 1 answer

Q2. What is polymorphism and explain with examples you used in your project

Ans.

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

View 1 answer

Q3. How to point to any other branch other than master in Jenkins

Ans.

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

Add your answer

Q4. Write SQL query to get the 10th highest salary from employee table

Ans.

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

View 1 answer
Discover TCS interview dos and don'ts from real experiences

Q5. What is abstraction and difference between interface and abstract class

Ans.

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

View 1 answer

Q6. What is the design pattern used in my framework

Ans.

I don't have the available data to answer this question.

  • N/A

View 1 answer
Are these interview questions helpful?

Q7. What is Maven and explain it's structure

Ans.

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

View 1 answer

Q8. Explain your framework in detail

Ans.

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.

View 1 answer
Share interview questions and help millions of jobseekers 🌟

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?

Ans.

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

Add your answer

Q10. Write SQL query to delete duplicate records

Ans.

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

Add your answer

Q11. How to link TestNG file in Maven POM

Ans.

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

Add your answer

Q12. What is setting.xml in Maven

Ans.

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.

Add your answer

Q13. 1. Explain your project. 2. Explain Oops concept

Ans.

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

Add your answer

Q14. What is sprint retrospective

Ans.

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

Add your answer

Q15. what is sprint backlog

Ans.

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

Add your answer

Q16. reverse string java program

Ans.

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'

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at TCS

based on 5 interviews
1 Interview rounds
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Automation Test Engineer Interview Questions from Similar Companies

3.7
 • 58 Interview Questions
3.8
 • 33 Interview Questions
3.8
 • 31 Interview Questions
3.9
 • 20 Interview Questions
3.4
 • 18 Interview Questions
3.8
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter