TCS Technical Interview Questions and Answers Updated On Dec 2019
TCS Technical Interview Questions and Answers Updated On Dec 2019
The Campus Interview
This interview usually takes 45 minutes to an hour and may have one or two interviewers. One interviewe
communication skills, self-management skills and background by asking behavioral questions. The othe
capabilities.
If TCS not coming to your school this fall, and you have probably submitted your resume online. You look
like to have an employment discussion with candidate. They will set up a mutually-convenient date and t
Your interviewer will assess your communication skills, self-management skills and background by askin
may also assess your technical ability. If the phone interview goes well, you will be asked to join us for a
k
Point to remember: Before interview You should decide your Favorite programming language and be pr
db
f
1.JAVA is Object-Oriented while C is procedural.
7.JAVA supports Method Overloading while C does not support overloading at all.
8.Unlike C, JAVA does not support Preprocessors, & does not really them.
9.The standard Input & Output Functions--C uses the printf & scanf functions as its standard input & outp
System.out.print & System.in.read functions.
10.Exception Handling in JAVA And the errors & crashes in C.
3.In header files whether functions are declared or defined?
Functions are declared within header file. That is function prototypes exist in a header file,not function b
(lib).
k
time for replacing the same values.
db
8.Difference between pass by reference and pass by value?
f
Pass by value just passes the value from caller to calling function so the called function cannot modify t
Pass by reference will pass the address to the caller function instead of value if called function requires
directly modify.
9.What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior
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 cre
specifics of the working of a class.
k
db
Function overloading: C++ enables several functions of the same name to be defined, as long as these fu
parameters (at least as far as their types are concerned). This capability is called function overloading. W
f
called, the C++ compiler selects the proper function by examining the number, types and order of the arg
overloading is commonly used to create several functions of the same name that perform similar tasks
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-
operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add
language (but they can improve understandability and reduce maintenance costs).
An abstract class is a class which does not fully represent an object. Instead, it represents a broad range
However, this representation extends only to the features that those classes of objects have in common
only a partial description of its objects.
The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined re
parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc s
the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size pa
pointer to the block. The pointer specified by the Pointer parameter must have been created with the ma
and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer para
k
21.What are the differences between structures and arrays?
db
Arrays is a group of similar data types but Structures can be group of different data types
f
22.What is data structure?
A data structure is a way of organizing data that considers not only the items stored, but also their relati
knowledge about the relationship between data items allows designing of efficient algorithms for the ma
23. Can you list out the areas in which data structures are applied extensively?
Compiler Design,
Operating System,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
24.What are the advantages of inheritance?
It permits code reusability. Reusability saves time in program development. It encourages the reuse of p
software, thus reducing problem after a system becomes functional.
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 be
is being held by another waiting process, which in turn is waiting for another resource. If a process is un
indefinitely because the resources requested by it are being used by other waiting process, then the syst
Mutual Exclusion: At least one resource must be non-shareable.[1] Only one process can use the resourc
Hold and Wait or Resource Holding: A process is currently holding at least one resource and requesting
being held by other processes.
No Preemption: The operating system must not de-allocate resources once they have been allocated; th
holding process voluntarily.
Circular Wait: A process must be waiting for a resource which is being held by another process, which in
process to release the resource. In general, there is a set of waiting processes, P = {P1, P2, ..., PN}, such
k
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.[
db
Thus prevention of deadlock is possible by ensuring that at least one of the four conditions cannot hold.
f
27. What is Insertion sort, selection sort, bubble sort( basic differences among the functionality of the
algorithms)
A doubly linked list is a linked data structure that consists of a set of sequentially linked records called n
fields, called links, that are references to the previous and to the next node in the sequence of nodes. Th
previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to
there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptua
formed from the same data items, but in opposite sequential orders.
29.What is data abstraction? what are the three levels of data abstraction with Example?
Abstraction is the process of recognizing and focusing on important characteristics of a situation or obj
un-wanted characteristics of that situation or object.
Lets take a person as example and see how that person is abstracted in various situations
A doctor sees (abstracts) the person as patient. The doctor is interested in name, height, weight, age, blo
diseases etc of a person
An employer sees (abstracts) a person as Employee. The employer is interested in name, age, health, de
etc of a person.
Abstraction is the basis for software development. Its through abstraction we define the essential aspec
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.
Getting the arguments from command prompt in c is known as command line arguments. In c main func
are:
Argument counter
Argument vector
Environment vector
k
Macro gets to see the Compilation environment, so it can expand #defines. It is expanded by the preproc
db
f
32.What are the different storage classes in C?
Auto,register,static,extern
33.Which header file should you include if you are to develop a function which can accept variable num
stdarg.h
Cache Memory is used by the central processing unit of a computer to reduce the average time to acces
smaller, faster memory
which stores copies of the data from the most frequently used main memory locations. As long as most
memory locations, the average
latency of memory accesses will be closer to the cache latency than to the latency of main memory.
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
Data structure alignment is the way data is arranged and accessed in computer memory. It consists of t
data alignment and data structure padding.
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 o
new to allocate memory, but then it invokes the constructor for the right type of object, so the result is a
memory. If that object contains any other objects (either embedded or as base classes) those construct
The keyword delete is used to destroy the single variable memory created dynamically which is pointed
k
Eg:int *r=new(int a[10])
The memory pointed by r can be deleted by delete []r.
db
f
40. What is conversion constructor?
A conversion constructor is a single-parameter constructor that is declared without the function specifie
conversion constructors to convert objects from the type of the first parameter to the type of the conver
implicit conversions, C++ uses conversion constructors, constructors that accept a single parameter and
of that parameter.
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 dat
method. A data warehouse is premeditated and generated for supporting the decision making process w
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 o
becomes easier to report and analyze information.
o Many inconsistencies are identified and resolved before loading of information in data warehousing. T
analyzing process simpler.
o The best part of data warehousing is that the information is under the control of users, so that in case
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 withou
system.
o Data warehousing enhances the value of operational business applications and customer relationship
o Data warehousing also leads to proper functioning of support system applications like trend reports, e
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?
k
Stack data structure . Because of its LIFO (Last In First Out) property it remembers its caller so knows w
has to return. Recursion makes use of system stack for storing the return addresses of the function calls
db
equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written,
f
44.Differentiate between Complier and Interpreter?
An interpreter reads one instruction at a time and carries out the actions implied by that instruction. It do
But a compiler translates the entire instructions
46.What is an interrupt?
Interrupt is an asynchronous signal informing a program that an event has occurred. When a program
takes a specified action.
Garbage collection is the systematic recovery of pooled computer storage that is being used by a progra
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 sto
which case it may no longer be able to function).
Garbage collection is an automatic memory management feature in many modern programming langua
in the .NET framework. Languages that use garbage collection are often interpreted or run within a virtua
case, the environment that runs the code is also responsible for garbage collection.
k
right = size-1;
db
while(left <= right)
f
{
middle = ((left + right)/2);
if(item == arr[middle])
{
return(middle);
}
The static identifier is used for initializing only once, and the value retains during the life time of the prog
memory is allocated for static variables. This value can be used between function calls. The default va
variable is zero. A function can also be defined as a static function, which has the same scope of the sta
53.What is Cryptography?
Cryptography is the science of enabling secure communications between a sender and one or more reci
sender scrambling a message (with a computer program and a secret key) and leaving the recipient to u
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
k
54.What is encryption?
db
Encryption is the transformation of information from readable form into some unreadable form.
f
55.What is decryption?
Decryption is the reverse of encryption; it's the transformation of encrypted data back into some intelligi
Previous
k
db
f