One Network Enterprises
TCS Interview Questions and Answers
Q1. Override equals methods
Overriding the equals method allows for custom comparison logic in Java classes.
Override the equals method in a class to provide custom comparison logic.
Ensure the overridden equals method follows the contract specified in the Java documentation.
Consider overriding the hashCode method as well when overriding equals to maintain consistency.
Q2. write the program to reverse a string
Program to reverse a string using array of characters
Create an array of characters to store the input string
Iterate through the input string and store each character in the array
Iterate through the array in reverse order to construct the reversed string
Q3. diff between put and post method
PUT is used to update or replace an existing resource, while POST is used to create a new resource.
PUT is idempotent, meaning multiple identical requests will have the same effect as a single request.
POST is not idempotent, meaning multiple identical requests may have different effects.
PUT is used when the client knows the specific URI of the resource it wants to update.
POST is used when the server assigns a URI for the newly created resource.
Q4. method used in rest AP
REST APIs typically use HTTP methods like GET, POST, PUT, DELETE to perform CRUD operations on resources.
GET - retrieve data from a server
POST - create new data on a server
PUT - update existing data on a server
DELETE - remove data from a server
Q5. What are Test case designed techniques ?
Test case design techniques are methods used to create test cases for software testing.
Boundary Value Analysis
Equivalence Partitioning
Decision Table Testing
State Transition Testing
Use Case Testing
Q6. Root cause analysis techniques
Root cause analysis techniques are used to identify the underlying cause of a problem or issue.
Fishbone diagram (Ishikawa diagram)
5 Whys technique
Pareto analysis
Fault tree analysis
Failure mode and effects analysis (FMEA)
Q7. 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 Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month