Commonly Asked Technical Questions at a TCS Interview
The interview can take 45 minutes to an hour and may have one or two interviewers. One of them may focus on your self-management skills, communication skills, and background by asking behavioral questions. The other will be interested in your technical capabilities.
Here we are focusing on the commonly asked technical questions.
Technical Questions for TCS Interview
- What is your strongest programming language (Java, ASP, C, C++, VB, HTML, C#, etc.)?
Before the interview you must decide your favourite programming language or the language you are best at.
- What is the difference between C and Java?
- JAVA is Object-Oriented while C is procedural.
- Java is an Interpreted language while C is a compiled language.
- C is a low-level language while JAVA is a high-level language.
- JAVA uses the bottom-up approach while C uses the top-down approach.
- Pointer goes backstage in JAVA whereas C requires explicit handling of pointers.
- The standard Input & Output Functions–C uses the printf & scanf functions as its standard input & output while JAVA uses the System.out.print & System.in.read functions.
- Functions are declared or defined in header files?
Functions are declared within header file. That is function prototypes exist in a header file, not function bodies. They are defined in library (lib).
- What are the different storage classes in C?
There are four different types of storage classes in C. They are extern, register, static and auto.
- What do you understand by static variable?
Static variable is an access qualifier. If a variable is declared as static inside a function, the scope is limited to the function, but it will exists for the life time of the program. Values will be persisted between successive calls to a function.
- How do you print an address?
Address is printed by using “%p” in “printf”.
- What are macros? What are its advantages and disadvantages?
Macros are processor directive which will be replaced at compile time.
The disadvantage with macros is that they just replace the code they are not function calls.
The advantage is they can reduce time for replacing the same values.
- What’s the difference pass by value and between pass by reference?
Pass by value just passes the value from caller to calling function so the called function cannot modify the values in caller function. But Pass by reference will pass the address to the caller function instead of value if called function requires modifying any value it can directly modify.
9. What is an object?
Object is a software bundle of variables and related methods. Objects have state and behavior.
- 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.
- What is the difference between structure and class?
Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also.
The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.
- What is the difference between void pointer and null pointer?
A Null pointer has the value 0. Void pointer is a generic pointer introduced by ANSI. Generic pointer (Void pointer) can hold the address of any data type.
- What is function overloading?
Function overloading is a feature of C++ that allows us to create multiple functions with the same name, so long as they have different parameters.
Consider the following function:
int Add(int nX, int nY)
return nX + nY;
- What is operator overloading and function overloading?Function overloading: C++ enables many 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.
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes.
- What is encryption?Encryption is the transformation of information from readable form into an unreadable form.
- What is decryption?
Decryption is the reverse of encryption; it’s the transformation of encrypted data back into some readable form.
- What exactly is a digital signature?
A digital signature is an encrypted version of a message digest, attached together with a message. 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 similar task for an electronic message.