TCS Technical Interview Questions
TCS Technical Interview Questions
TCS Technical Interview Questions
1. What is your strongest programming language (Java, ASP, C, C++, VB, HTML, C#,
etc.)?
Point to remember: Before interview You should decide your Favorite programming language
and be prepared based on that question.
10.What is a class?
Class is a user-defined data type in C++. It can be created to solve a particular kind of problem.
After creation the user need not know the specifics of the working of a class.
Function overloading: C++ enables several functions of the same name to be defined, as long as
these functions have different sets of parameters (at least as far as their types are concerned).
This capability is called function overloading. When an overloaded function is called, the C++
compiler selects the proper function by examining the number, types and order of the arguments
in the call. Function overloading is commonly used to create several functions of the same name
that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects
of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls.
They form a pleasant facade that doesn't add anything fundamental to the language (but they can
improve understandability and reduce maintenance costs).
26. Tell something about deadlock and how can we prevent dead lock?
In an operating system, a deadlock is a situation which occurs when a process enters a waiting
state because a resource requested by it is being held by another waiting process, which in turn is
waiting for another resource. If a process is unable to change its state indefinitely because the
resources requested by it are being used by other waiting process, then the system is said to be in
a deadlock.
Mutual Exclusion: At least one resource must be non-shareable.[1] Only one process can use the
resource at any given instant of time.
Hold and Wait or Resource Holding: A process is currently holding at least one resource and
requesting additional resources which are being held by other processes.
No Preemption: The operating system must not de-allocate resources once they have been
allocated; they must be released by the holding process voluntarily.
Circular Wait: A process must be waiting for a resource which is being held by another process,
which in turn is waiting for the first process to release the resource. In general, there is a set of
waiting processes, P = {P1, P2, ..., PN}, such that P1 is waiting for a resource held by P2, P2 is
waiting for a resource held by P3 and so on till PN is waiting for a resource held by P1.[1][7]
Thus prevention of deadlock is possible by ensuring that at least one of the four conditions
cannot hold.
27. What is Insertion sort, selection sort, bubble sort( basic differences among the
functionality of the three sorts and not the exact algorithms)
A doctor sees (abstracts) the person as patient. The doctor is interested in name, height, weight,
age, blood group, previous or existing diseases etc of a person
An employer sees (abstracts) a person as Employee. The employer is interested in name, age,
health, degree of study, work experience etc of a person.
Abstraction is the basis for software development. Its through abstraction we define the essential
aspects of a system. The process of identifying the abstractions for a given system is called as
Modeling (or object modeling).
Three levels of data abstraction are:
1. Physical level : how the data is stored physically and where it is stored in database.
2. Logical level : what information or data is stored in the database. eg: Database administrator
3.View level : end users work on view level. if any amendment is made it can be saved by other
name.
33.Which header file should you include if you are to develop a function which can accept
variable number of arguments?
stdarg.h
35.What is debugger?
A debugger or debugging tool is a computer program that is used to test and debug other
programs
36. Const char *p , char const *p What is the difference between the above two?
1) const char *p - Pointer to a Constant char ('p' isn't modifiable but the pointer is)
2) char const *p - Also pointer to a constant Char
However if you had something like:
char * const p - This declares 'p' to be a constant pointer to an char. (Char p is modifiable but the
pointer isn't)
38.Explain the difference between 'operator new' and the 'new' operator?
The difference between the two is that operator new just allocates raw memory,
nothing else. The new operator starts by using operator new to allocate memory, but
then it invokes the constructor for the right type of object, so the result is a real live
object created in that memory. If that object contains any other objects (either
embedded or as base classes) those constructors as invoked as well.
42. Why should we use data ware housing and how can you extract data for analysis with
example?
If you want to get information on all the techniques of designing, maintaining, building and
retrieving data, Data warehousing is the ideal method. A data warehouse is premeditated and
generated for supporting the decision making process within an organization.
Here are some of the benefits of a data warehouse:
o With data warehousing, you can provide a common data model for different interest areas
regardless of data's source. In this way, it becomes easier to report and analyze information.
o Many inconsistencies are identified and resolved before loading of information in data
warehousing. This makes the reporting and analyzing process simpler.
o The best part of data warehousing is that the information is under the control of users, so that in
case the system gets purged over time, information can be easily and safely stored for longer
time period.
o Because of being different from operational systems, a data warehouse helps in retrieving data
without slowing down the operational system.
o Data warehousing enhances the value of operational business applications and customer
relationship management systems.
o Data warehousing also leads to proper functioning of support system applications like trend
reports, exception reports and the actual performance analyzing reports.
Data mining is a powerful new technology to extract data for analysis.
43.Explain recursive function & what is the data structures used to perform recursion?
a) A recursive function is a function which calls itself.
b) The speed of a recursive program is slower because of stack overheads. (This attribute is
evident if you run above C program.)
c) A recursive function must have recursive conditions, terminating conditions, and recursive
expressions.
Stack data structure . Because of its LIFO (Last In First Out) property it remembers its caller so
knows whom to return when the function has to return. Recursion makes use of system stack for
storing the return addresses of the function calls. Every recursive function has its equivalent
iterative (non-recursive) function. Even when such equivalent iterative procedures are written,
explicit stack is to be used.
46.What is an interrupt?
Interrupt is an asynchronous signal informing a program that an event has occurred. When a
program receives an interrupt signal, it takes a specified action.
Garbage collection is the systematic recovery of pooled computer storage that is being used by a
program when that program no longer needs the storage. This frees the storage for use by other
programs
(or processes within a program). It also ensures that a program using increasing amounts of
pooled storage does not reach its quota (in which case it may no longer be able to function).
if(item == arr[middle])
{
return(middle);
}
return(-1);
}
53.What is Cryptography?
Cryptography is the science of enabling secure communications between a sender and
one or more recipients. This is achieved by the sender scrambling a message (with a
computer program and a secret key) and leaving the recipient to unscramble the
message (with the same computer program and a key, which may or may not be the
same as the sender's key).
There are two types of cryptography: Secret/Symmetric Key Cryptography and Public
Key Cryptography
54.What is encryption?
Encryption is the transformation of information from readable form into some unreadable form.
55.What is decryption?
Decryption is the reverse of encryption; it's the transformation of encrypted data back into some
intelligible form.
56.What exactly is a digital signature?
Just as a handwritten signature is affixed to a printed letter for verification that the letter
originated from its purported sender, digital signature performs the same task for an electronic
message. A digital signature is an encrypted version of a message digest, attached together with a
message.
My Technical Round : –
Q: Which programming language you know better?
A: Answered
Q: Write a database connection code as well as retrieval of records from data in any language.
A: Wrote.
Q: Write a nested query.
A: Wrote.
Q: Explain that nested query.
A: Explained
Q: Make tables for that nested query and identify primary key and other keys.
A: Did.
Q: There are two programs, PrintA.java and PrintB.java. Write some code so that these programs
can send messages to each other.
A: Tried socket programming somewhat, But not correct exactly.
They saw my application form into their computer and said, “You are not the same guy as in the
photo in application form.”
I said, “This is me”, again and again without any problem like stress and lack of confidence. This
was just a type of stress testing. Be careful with such questions.
Q: What are your hobbies?
A: Said same as what I mentioned in my resume.
Q: What’s going on in IT industry? Anything fresh?
A: TCS market share has been down by 9.15% last night. (I heard it in morning from my
classmates.)
Q: Your permanent address, phone no., Home no.?
A: Answered. (They were cross checking from my application form.)
Q: What are the areas of improvement in yourself based on this interview?
A: I don’t think any. If you can tell me, then it will be my pleasure.
They said, “You voice is loud”
I said, “Yes sir, my friends also say that I have a inbuilt loud speaker by birth.”
They said, “Hmm.”
Again they said, “Also you are looking little bit over confident.”
I said, “Yes sir, maybe, because I was trying to be confident.”
They said, “Yeah, improve in it.”
I said, “Yes sir, Thank you sir.”
They said, “yeah. You can go now.”
There are many more questions asked. But, I do not remember them. Guys they checked my
basic knowledge completely. They were not actually sitting to check your knowledge. They
actually check your confidence also. So, if u don’t know something. Say it clearly instead of
making false statement…
Tips:
# Be confident.
# Practice to enter in the room for that day.
# Explain in short.
# Have a smile on your face (descent) while explaining.
# U must have a deo and chewing gum for refreshing yourself
# Be Specific whatever you explain
# Properly dressed
# Check your body language
# Accept if u had made a mistake instantly
# It should be more conversational than Q and A session.
HR: –
Me: May I come in sir?
HR: yes
Me: Good Afternoon sir, May I sit
HR: Yes
HR: What should I ask you?
Me: Whatever you want to ask.
HR: Okay, Which type of questions do you want me to ask?
Me: Sir, please ask questions on real life.
HR: Okay, which questions?
Me: Like, How to deal with the world? How to live in a society?
HR: Okay. Tell me. How?
ME: I answered well as the question was of my choice or mine. I said I could know any person
well in just 10-15 days.
HR: Suppose a foreign client with completely different tradition and culture came to work with
you on a short term project of just 10 days. To work on this project together, you both must
know each other well. But as you said you take 14-15 days to know a person, and here you have
to finish the project within 10 days. What approach will you follow to deal with such situation?
ME: I will check his social networking profile like Facebook, Twitter etc. to know about him.
HR: He don’t have any account on these social networking sites. Then?
ME: I will ask about him with others who know him.
HR: Okay, this is one point, What else?
ME: I will try to spend more time with him like going for coffee or movie.
HR: And if client is female, then also you will go for movie with her?
ME: Sir, I can’t differentiate between males and females. This is my work and I will do it.
They smiled.
After that, they explained about TCS policy, bond, joining time details and I said, “Yes, yes sir”.
At last, they said yes, you can go now.
I said, “Sir, please may I ask something?”
They said, “Yes.”
ME: Sir, what are qualities a TCSian should have?
HR: you say.
ME: “I don’t know sir. But in technical I got some feedback. I can tell you.”
HR: say.
ME: I said whatever feedback I got in my technical round which was loud voice and over
confidence.
HR: yes.. (Also they listed some improvements in mine).
(A B.Engg. – Civil student from Panjab University with profile as 6.9 CGPA and having 71.4 % in 12th and
89.7 % in 10th.)
Technical interview:
"Let's say that you have 25 horses, and you want to pick the fastest 3 horses out of those 25. In each race, only 5 horses can run at the
same time because there are only 5 tracks. What is the minimum number of races required to find the 3 fastest horses without using a
stopwatch?"
Describe an experience of yours wherein you were asked to do something which you didn't like to do and how you handled it?
What are your expectations from the company? Will you be comfortable relocating?