Ohhpro Technologies
TCS Interview Questions and Answers
Q1. Write a Program to remove duplicate elements from ArrayList.
Program to remove duplicate elements from ArrayList
Create a new HashSet to store unique elements
Iterate through the ArrayList and add elements to the HashSet
Convert the HashSet back to an ArrayList to remove duplicates
Q2. Write a Program to print Longest non repeating substring.
Program to print Longest non repeating substring
Use a sliding window approach to iterate through the string
Keep track of the characters seen so far in a set
Update the start index of the substring when a repeating character is encountered
Calculate the length of the current substring and update the longest substring found so far
Q3. Create DB schema and Build RESTFul API using SpringBoot,
Design DB schema and create RESTFul API using SpringBoot
Design the database schema with tables, relationships, and constraints
Create entity classes in Java corresponding to the database tables
Use Spring Data JPA to interact with the database
Implement RESTful endpoints using Spring Boot controllers
Use annotations like @GetMapping, @PostMapping, @PutMapping, @DeleteMapping for mapping HTTP requests to controller methods
Serialize and deserialize data using JSON for API communica...read more
Q4. Write a Java program to reverse a string.
A Java program to reverse a string.
Create a char array from the input string
Use two pointers to swap characters from start and end of the array
Convert the char array back to a string and return
Q5. Make a calculator app with all functionality
A calculator app with all functionality
Create a UI with buttons for numbers, operators, and functions
Implement logic to perform calculations based on user input
Include features like memory functions, history of calculations, and error handling
Q6. Creating dynamic form from given dataset
Use the dataset to dynamically create a form.
Iterate through the dataset to generate form fields
Use React state to manage form data
Implement validation for form fields
Handle form submission to send data
Interview Process at TCS
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month