Add office photos
Employer?
Claim Account for FREE

Scan-IT

3.8
based on 39 Reviews
Filter interviews by

TCS Interview Questions and Answers

Updated 13 Apr 2024

Q1. What is Reflection class in java

Ans.

Reflection class in Java provides a way to examine or modify the behavior of methods, classes, interfaces at runtime.

  • Reflection allows accessing private fields, methods, and constructors of a class.

  • It enables dynamic loading of classes and creation of new objects.

  • Used in frameworks like Spring and Hibernate for dependency injection and object-relational mapping.

  • Example: Class.forName("com.example.MyClass") returns the Class object for the given class name.

Add your answer

Q2. SQL Query to get top 10 salary from employee table

Ans.

SQL query to retrieve top 10 salaries from employee table.

  • Use SELECT statement to retrieve data from employee table

  • Use ORDER BY clause to sort the data in descending order based on salary

  • Use LIMIT clause to limit the result set to top 10 salaries

Add your answer

Q3. Contract between hashcode and equals method

Ans.

The contract between hashCode and equals method is that if two objects are equal according to equals method, their hash codes must be equal as well.

  • The hashCode method returns an integer value that represents the object's unique identifier.

  • The equals method is used to compare two objects for equality.

  • According to the contract, if two objects are equal, their hash codes must be equal.

  • If the hashCode method is overridden, the equals method should also be overridden to maintain ...read more

Add your answer

Q4. 1.What is Reflection in java

Ans.

Reflection in Java allows programmatic access to information about the fields, methods, and constructors of loaded classes.

  • Reflection provides the ability to examine and modify the behavior of classes, interfaces, and objects at runtime.

  • It allows accessing and manipulating fields, methods, and constructors that are otherwise inaccessible.

  • Reflection is commonly used in frameworks, libraries, and tools that require runtime analysis and modification of code.

  • Example: Retrieving t...read more

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

Q5. String equals and == method

Ans.

The equals() method compares the content of two strings, while the == operator compares their references.

  • The equals() method returns true if the content of two strings is the same.

  • The == operator returns true if the references of two strings are the same.

  • Example: String str1 = "Hello"; String str2 = new String("Hello"); str1.equals(str2) returns true, but str1 == str2 returns false.

Add your answer

Q6. explain oops concept

Ans.

OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects, which can contain data and code.

  • OOPs focuses on creating objects that interact with each other to solve problems

  • Key concepts include encapsulation, inheritance, polymorphism, and abstraction

  • Encapsulation involves bundling data and methods that operate on the data into a single unit

  • Inheritance allows one class to inherit properties and behavior from another class

  • Polymorphism allows ob...read more

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

Interview Process at TCS

based on 3 interviews in the last 1 year
Interview experience
4.3
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.9
 • 675 Interview Questions
3.5
 • 417 Interview Questions
3.9
 • 253 Interview Questions
3.7
 • 179 Interview Questions
3.8
 • 152 Interview Questions
4.0
 • 133 Interview Questions
View all
Top Scan-IT Interview Questions And Answers
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
Get AmbitionBox app

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