Add office photos
Engaged Employer

LTIMindtree

3.8
based on 21.1k Reviews
Filter interviews by

TCS Interview Questions and Answers

Updated 2 Sep 2024
Popular Designations

Q1. Explain framework used for selenium

Ans.

Selenium is an open-source automation testing framework used for web applications.

  • Selenium supports multiple programming languages like Java, Python, C#, etc.

  • It consists of Selenium WebDriver, Selenium IDE, and Selenium Grid.

  • Selenium WebDriver is used for automating web applications by interacting with the web elements.

  • Selenium IDE is a record and playback tool for creating test cases.

  • Selenium Grid is used for parallel testing across different browsers and environments.

Add your answer

Q2. Checked and unchecked exceptions.

Ans.

Checked exceptions are checked at compile time, while unchecked exceptions are not.

  • Checked exceptions must be either caught or declared in the method signature using 'throws' keyword.

  • Unchecked exceptions do not need to be explicitly handled.

  • Examples of checked exceptions include IOException, ClassNotFoundException.

  • Examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException.

Add your answer

Q3. Reverse String without using loop

Ans.

Reverse string without using loop

  • Use recursion to reverse the string

  • Base case: if string length is 0 or 1, return the string

  • Recursive case: return the last character + reverse(rest of the string)

Add your answer

Q4. Parenthesis Balancing using stack

Ans.

Implement a parenthesis balancing algorithm using a stack

  • Use a stack to keep track of opening parentheses

  • When encountering a closing parenthesis, pop from stack and check if it matches the closing parenthesis

  • If stack is empty or mismatched parentheses, return false

  • If all parentheses are balanced, return true

Add your answer
Discover TCS interview dos and don'ts from real experiences

Q5. Exceptions in selenium

Ans.

Exceptions in Selenium are errors that occur during test execution, such as ElementNotVisibleException or TimeoutException.

  • Selenium WebDriver throws exceptions when it encounters errors during test execution.

  • Common exceptions include NoSuchElementException, ElementNotVisibleException, TimeoutException, StaleElementReferenceException, and WebDriverException.

  • Handling exceptions in Selenium can be done using try-catch blocks or using TestNG annotations like @Test(expectedExcepti...read more

Add your answer

Q6. Waits in selenium

Ans.

Waits in Selenium are used to synchronize tests with the browser's state.

  • Waits help to handle synchronization issues in Selenium tests

  • There are two types of waits in Selenium - Implicit Wait and Explicit Wait

  • Implicit Wait sets a default waiting time for the entire test script

  • Explicit Wait allows the test to wait for a certain condition to be met before proceeding

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

Interview Process at TCS

based on 3 interviews
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Sdet Interview Questions from Similar Companies

4.0
 • 11 Interview Questions
4.4
 • 11 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
75 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