Professional Documents
Culture Documents
Recruitment Process :
TCS conducts 4 rounds to select freshers as Assistant System Engineer in their
organisation.
Written Round
Technical Round
Managerial Round
HR Round
Technical Round :
The students who clear the written round are called for Technical Interview. There is
no hard & fast rule for which questions will be asked in this round, you can expect
questions on any topic depending on the panel. To clear this round you should be
clear with your basics. You should be prepared with Data structures and Algorithms,
DBMS, Operating System, Networking, OOPs concepts and a programming language
of your choice. Students from branches other than CS should prepare for the other
two subjects related to their branch. CS students will be expected to write codes in the
interview. You may be asked puzzles in this round. To be prepared for puzzles you
can practice from our Puzzles section.
Managerial Round :
This round includes everything which was in Technical round plus it will be under
pressure and a lot of cross-checking. Doubts will be raised on your answers to check if
you can handle stress or not. Students may or may not be sent to this round depending
on the feedback of the previous round. If the feedback of the previous round was good
you may expect to directly been sent to HR round. Key for this round is to be calm,
confident, clear on your thoughts and to not give up on pressure. If you don’t know the
answer you must try to attempt it with whatever you know.
HR Round :
This is the final round of the recruitment process. The interview panel can question you
anything related to your personality, family, education, hobbies, internships, general
knowledge, basic HR questions like Why should I hire you?, If any problem in relocation
etc. The key here is to be confident about everything you speak.
Questions Asked in TCS :
1. Check if the door is open or closed
2. Extract the Number from the String
3. Number Of Open Doors
4. Linked List Insertion
5. Binary Search
6. How would you find the second largest salary in table?
7. Prefix and Postfix
8. What is a spanning Tree ?
9. Explain 3NF ?
10. What is friend function ?
11. What does static variable mean?
12. Difference between C++ and Java
13. Difference between run time binding and compile time binding
Show entries
Search:
Valid
Probability of
TCS Digital Interview Questions and Answers Difficulty for Non
being asked
CS/IT
Basic definitions of Data Analytics, Artificial Intelligence, Medium (just Low Yes
Cloud Computing etc. basics)
#Which data structures are used for BFS and DFS of a graph?
Queue is used for BFS
Stack is used for DFS. DFS can also be implemented using recursion (Note that
recursion also uses function call stack).
Final keyword in java is used to restrict usage of variable, class and method.
Variable: Value of Final variable is constant, you can not change it.
Method: you can’t override a Final method.
Class: you can’t inherit from Final class.
Refer this for details
Java supports multiple inheritance but not through classes, it supports only through its
interfaces. The reason for not supporting multiple inheritance is to avoid the conflict and
complexity arises due to it and keep Java a Simple Object Oriented Language. If we
recall this in C++, there is a special case of multiple inheritance (diamond problem)
where you have a multiple inheritance with two classes which have methods in conflicts.
So, Java developers decided to avoid such conflicts and didn’t allow multiple inheritance
through classes at all.
Why the main method is static in java?
What is an abstract class? How abstract classes are similar or different in Java
from C++?
Abstract classes are classes that contain one or more abstract methods. An abstract
method is a method that is declared, but contains no implementation. Abstract classes
may not be instantiated, and require subclasses to provide implementations for the
abstract methods.
Like C++, in Java, an instance of an abstract class cannot be created, we can have
references of abstract class type though.
Like C++, an abstract class can contain constructors in Java. And a constructor of
abstract class is called when an instance of a inherited class is created
In Java, we can have an abstract class without any abstract method. This allows
us to create classes that cannot be instantiated, but can only be inherited.
Abstract classes can also have final methods (methods that cannot be overridden).
For example, the following program compiles and runs fine
What is the difference between ‘throw’ and ‘throws’ in Java Exception Handling?
What will happen if you put System.exit(0) on try or catch block? Will finally block
execute?
By Calling System.exit(0) in try or catch block, we can skip the finally block. System.exit(int)
method can throw a SecurityException. If Sysytem.exit(0) exits the JVM without throwing that
exception then finally block will not execute. But, if System.exit(0) does throw security exception
then finally block will be executed.
What is finalize() method?
Unlike c++ , we don’t need to destroy objects explicitly in Java. ‘Garbage Collector‘ does
that automatically for us. Garbage Collector checks if no references to an object exist,
that object is assumed to be no longer required, and the memory occupied by the object
can be freed. Sometimes an object can hold non-java resources such as file handle or
database connection, then you want to make sure these resources are also released
before object is destroyed. To perform such operation Java provide protected void
finalize() in object class. You can override this method in your class and do the required
tasks. Right before an object is freed, the java run time calls the finalize() method on
that object. Refer this for more details.
Answer: 25000
Divide the lifetime of spare tire into 4 equal part i.e., 5000 and swap it at each
completion of 5000 miles distance.
Let four tyres be A, B, C and D and spare tyre be S.
5000 KMs: Replace A with S. Remaining distances (A, B, C, D, S) : 15000, 15000,
15000, 15000, 20000
10000 KMs: Put A back to its original position and replace B with S. Remaining
distances (A, B, C, D, S) : 15000, 10000, 10000, 10000, 15000
15000 KMs: Put B back to its original position and replace C with S. Remaining
distances (A, B, C, D, S) : 10000, 10000, 5000, 5000, 10000
20000 KMs: Put C back to its original position and replace D with S. Remaining
distances (A, B, C, D, S) : 5000, 5000, 5000, 0, 5000
25000 KMs : Every tyre is now worn out completely.
All tyres are used upto their full strength.
Puzzle 10 | (A Man with Medical Condition and 2 Pills)
A man has a medical condition that requires him to take two kinds of pills, call them A
and B. The man must take exactly one A pill and exactly one B pill each day, or he will
die. The pills are taken by first dissolving them in water.
The man has a jar of A pills and a jar of B pills. One day, as he is about to take his pills,
he takes out one A pill from the A jar and puts it in a glass of water. Then he
accidentally takes out two B pills from the B jar and puts them in the water. Now, he is in
the situation of having a glass of water with three dissolved pills, one A pill and two B
pills. Unfortunately, the pills are very expensive, so the thought of throwing out the water
with the 3 pills and starting over is out of the question. How should the man proceed in
order to get the right quantity of A and B while not wasting any pills?
Solution:
Add one more A pill to the glass and let it dissolve. Take half of the water today and half
tomorrow. It works under following assumptions.
The dissolved Pills can be used next day.
What is Abstraction?
The first thing with which one is confronted when writing programs is the problem. Typically
we are confronted with “real-life” problems and we want to make life easier by providing a
program for the problem. However, real-life problems are nebulous and the first thing we have
to do is to try to understand the problem to separate necessary from unnecessary details: We
try to obtain our own abstract view, or model, of the problem. This process of modeling is
called abstraction.