TCS Ninja Technical Interview Question

TCS Ninja Technical Interview has made the best of us a nervous wreck. So, to help you and guide you through the technical interview round, we provide you the sample questions which are likely to be asked in this round. 

Take Free TCS Ninja Exam


1. 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 object and leaving/filtering out the unwanted characteristics of that situation or object.

Let's take a person an example and see how that person is abstracted in various situations

A doctor sees (abstracts) the person as a patient. The doctor is interested in the 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 the name, age, health, the degree of study, work experience etc of a person.

Abstraction is the basis for software development. It is 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 a 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 names.

2. What is command line argument?

Getting the arguments from a command prompt in c is known as command line arguments. In C main function has three arguments. They are:

Argument counter
Argument vector
Environment vector

3. Advantages of a macro over a function?

Macro gets to see the Compilation environment, so it can expand #defines. It is expanded by the preprocessor.

4. What are the different storage classes in C?


5. Which header file should you include if you are to develop a function which can accept a variable number of arguments?


6. What is cache memory?

Cache Memory is used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory.

7. What is debugger?
A debugger or debugging tool is a computer program that is used to test and debug other programs

8. 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 a pointer to a constant Char

However, if you had something like:
char * const p - This declares 'p' to be a constant pointer to a char. (Char p is modifiable but the pointer isn't)

9. What is Memory Alignment?

Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding.

10. 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.

11. Difference between delete and delete[]?

The keyword delete is used to destroy the single variable memory created dynamically which is pointed by a single pointer variable.

Eg: int *r=new(int)
the memory pointed by r can be deleted by delete r.
delete [] is used to destroy an array of memory pointed by a single pointer variable.
Eg:int *r=new(int a[10])
The memory pointed by r can be deleted by delete []r.

12. What is conversion constructor?

A conversion constructor is a single-parameter constructor that is declared without the function specifier 'explicit'. The compiler uses conversion constructors to convert objects from the type of the first parameter to the type of the conversion constructor's class. To define implicit conversions, C++ uses conversion constructors, constructors that accept a single parameter and initialize an object to be a copy of that parameter.

13. What is a spanning Tree?

A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.

14. Why should we use data warehousing and how can you extract data for analysis with an 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:

  •  With data warehousing, you can provide a common data model for different interest areas regardless of the data's source. In this way, it becomes easier to report and analyze information.
  • Many inconsistencies are identified and resolved before loading of information in data warehousing. This makes the reporting and analyzing process simpler.
  • 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 a longer time period.
  • Because of being different from operational systems, a data warehouse helps in retrieving data without slowing down the operational system.
  • Data warehousing enhances the value of operational business applications and customer relationship management systems.
  • 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.

15. 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.

16. Differentiate between Compiler and Interpreter?
An interpreter reads one instruction at a time and carries out the actions implied by that instruction. It does not perform any translation. But a compiler translates the entire instructions

Get Top 30 IT Company's Placement Papers with 10,000+ Practice Questions

17. What is the scope of a variable?
Scope refers to the visibility of variables. It is very useful to be able to limit a variable's scope to a single function. In other words, the variable will have a limited scope


18. What is a user-defined exception in Java?

The keywords used in java application are try, catch and finally are used in implementing user-defined exceptions. This Exception class inherits all the method from Throwable class.

19. What is Java Applet?

The applet is a java program that can be embedded into HTML pages. Java applets run on the java enables web browsers such as Mozilla and internet explorer. The applet is designed to run remotely on the client browser, so there are some restrictions on it. Applet can't access system resources on the local computer. Applets are used to make the website more dynamic and entertaining.

20. What do you know about the garbage collector?

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).

Garbage collection is an automatic memory management feature in many modern programming languages, such as Java and languages in the .NET framework. Languages that use garbage collection are often interpreted or run within a virtual machine like the JVM. In each case, the environment that runs the code is also responsible for garbage collection.

21. Write a Binary Search program

int binarySearch(int arr[],int size, int item)
int left, right, middle;
left = 0;
right = size-1;

while(left <= right)
middle = ((left + right)/2);

if(item == arr[middle])

if(item > arr[middle])
left = middle+1;
right = middle-1;


22. What are enumerations?

An enumeration is a data type, used to declare a variable that store list of names. It acts like a database, which will store the list of items in the variable. example: enum shapes{triangle, rectangle,...

23. What a is a static identifier?

The static identifier is used for initializing only once, and the value retains during the lifetime of the program/application. A separate memory is allocated for ‘static’ variables. This value can be used between function calls. The default value of an uninitialized static variable is zero. A function can also be defined as a static function, which has the same scope of the static variable.

24. 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

25. What is encryption?

Encryption is the transformation of information for the om readable form into some unreadable form.

26. What is decryption?

Decryption is the reverse of encryption; it's the transformation of encrypted data back into some intelligible form.

27. 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.

28. What is an Interrupt?
An 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.

Check Other Blogs on TCS Ninja Recruitment

TCS Ninja Technical Interview Tips and FAQ's 

TCS Ninja HR Interview Tips and Strategies 

TCS Ninja Exam Advanced Coding Questions 

TCS Ninja English Section Sample Questions

TCS Ninja 10 day study plan 

TCS Ninja Academic Eligibility Criteria

TCS Ninja FAQ's


Published in Test Patterns

TCS Ninja Technical Interview Questions for Practices 

As the interviews of TCS Ninja came to an end, we came up with a list of questions which are frequently asked in the technical interviews. These questions are collected from different authentic sources who have attended the TCS Ninja Interviews. 

1. Which programming language do you know the best? (Java, ASP, C, C++, VB, HTML, C#, etc.)?

Prepare the language you are confident prior to the interview.

Take Free TCS Ninja Exam

2. Explain the differences between C and Java.

  • JAVA is an 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.
  • C uses the top-down approach while JAVA uses the bottom-up approach.
  • Pointer goes backstage in JAVA while C requires explicit handling of pointers.
  • The Behind-the-scenes Memory Management with JAVA & The User-Based Memory Management in C.
  • JAVA supports Method Overloading while C does not support overloading at all.
  • Unlike C, JAVA does not support Pre-processors, & does not really them.
  • The standard Input & Output Functions--C uses the printf & scanf functions as its standard input & output while JAVA uses the System.out.print & functions.
  • Exception Handling in JAVA And the errors & crashes in C.

3. Are the functions declared or defined in the header files?

Functions are declared within the header file. That is function prototypes exist in a header file and not in function bodies. They are defined in a library (lib).

4. What are the different storage classes in C?

There are four types of storage classes in C. They are extern, register, auto and static

5. What does a static variable mean?

Static is an access qualifier. If a variable is declared as static inside a function, the scope is limited to the function, but it will still exist for the lifetime of the program. Values will be persisted between successive calls to a function.

6. How do you print an address?

Use %p in printf to print the address.

7. 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 as they are not function calls. Similarly, the advantage is they can reduce the time for replacing the same values.

8.Difference between pass by reference and pass by value? 
Pass by value just passes the value from a caller to calling the 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 to modify any value it can directly modify.

9. What is an object?

An object is a software bundle of variables and related methods. Objects have state and behavior

10. What is a class?

A 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.

11. What is the difference between class and structure?

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.

12. What is a pointer?

A pointer is a variable in a program. It is something with a name, the value of which can vary. The way the compiler and linker handles a pointer is, that it assigns a specific block of memory within the computer to hold the value of that variable.

13. What is the difference between null and void pointer?

A Null pointer has the value 0. A void pointer is a generic pointer introduced by ANSI. A generic pointer can hold the address of any data type.

14. 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;}

15. What is function overloading and operator overloading?

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).

16. What is friend function?

A friend function for a class is used in object-oriented programming to allow access to public, private, or protected data in the class from the outside. Normally, a function that is not a member of a class cannot access such information; neither can an external class. Occasionally, such access will be advantageous for the programmer. Under these circumstances, the function or external class can be declared as a friend of the class using the friend keyword.

17. What do you mean by inline function?
The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.

18. Tell me something about abstract classes?

An abstract class is a class which does not fully represent an object. Instead, it represents a broad range of different classes of objects. However, this representation extends only to the features that those classes of objects have in common. Thus, an abstract class provides only a partial description of its objects.

19. What is the difference between realloc() and free()?

The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.

20. What is the difference between an array and a list?

An array is a collection of homogeneous elements. A list is the collection of heterogeneous elements.
For Array memory allocated is static and continuous. For List memory allocated is dynamic and Random.
Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.
The array uses direct access of stored members, list uses sequential access for members.

21. What are the differences between structures and arrays?

An array is a group of similar data types but Structures can be a group of different data types

22. What is data structure?
A data structure is a way of organizing data that considers not only the items stored but also their relationship to each other. Advance knowledge about the relationship between data items allows the designing of efficient algorithms for the manipulation of data.

23. Can you list out the areas in which data structures are applied extensively?

Compiler Design,

Operating System,

Database Management System,

Statistical analysis package,

Numerical Analysis,


Artificial Intelligence,


24. What are the advantages of inheritance?

It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.

Get Top 30 IT Company's Placement Papers with 10,000+ Practice Questions

25. What are the two integrity rules used in DBMS?

The two types of integrity rules are referential integrity rules and entity integrity rules. Referential integrity rules dictate that a database does not contain orphan foreign key values. This means that a primary key value cannot be modified if the value is used as a foreign key in a child table. Entity integrity dictates that the primary key value cannot be Null.

26. Tell something about deadlock and how can we prevent deadlock?

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 processes, 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 Doubly link list?

A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list. If there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly linked lists formed from the same data items but in opposite sequential orders.

 Check Other Blogs on TCS Ninja Recruitment

TCS Ninja Technical Interview Tips and FAQ's 

TCS Ninja HR Interview Tips and Strategies 

TCS Ninja Exam Advanced Coding Questions 

TCS Ninja English Section Sample Questions

TCS Ninja 10 day study plan 

TCS Ninja Academic Eligibility Criteria

TCS Ninja FAQ's

Published in Test Patterns

TCS Ninja Tech Interview and HR Interview

Over the past few months, the only name that was chanted by all tech students was TCS Ninja. Now that it has been over, let's have a look at the student experiences from the interviews of TCS Ninja. The past week just flew by for students who were attending the interviews.

In the interview, we see a pattern of variation in the questions that were asked. In the technical aspects, more scrutiny was done on the knowledge over language, project and latest technologies. People from other than CSC and IT backgrounds were asked the similar questions as the people from those backgrounds. Questions on Industrial Training, data structures, and different programs were asked.

When we look at the pattern, the interview was said to be moderately difficult. The interviewers mostly concentrated on the communication and analytical skills of the student than technical knowledge as it was already been tested in the written test. Personal details were also asked during the technical interview. As both the interviews are scheduled on the same day, students have not faced many issues with that. The technical interview was taken around 20 to 30 minutes whereas the HR interview was a much shorter one which was done in just10 to 15 minutes. It is seen that 'why do you want to join TCS?' is the most frequent question that has been asked in the HR round.

Get 120 Videos Group Discussion Techniques - Personal Interview Questions

TCS Ninja Technical Interview:

The interview started with an introduction about oneself and the background in graduation. Later they were asked several questions related to the subjects. As long as you are well prepared with the subject matters and appear confident, the interview is pretty moderate. During the technical interview, remember that you are expected to have a thorough knowledge of your project. It is given most importance in this round. The most frequent questions asked about coding and programming languages are: 

  • what is the function?
  • what are pointers and array?
  • what is the difference between stack and queue?
  • What is a circular linked list?
  • What is the difference between the array and linked list?
  • Write a program of inserting and deleting a node in a linked list?
  • swapping of two numbers without a third variable.
  • prime number program. 
Get Top 30 IT Company's Placement Papers with 10,000+ Practice Questions

TCS Ninja HR Interview:

During the HR interview, generic questions from choosing TCS to hobbies are asked. An HR interview comparatively is less serious and concentrates more on personality. They test your flexibility in work and how good of a team player you are. Also, terms and conditions of the company are sometimes explained here in the HR interview. Some common questions that can be asked are: 

  • What are your hobbies?
  • Do you believe in teamwork?
  • How to handle a situation when you have to work alone if your team members are on holiday and the order has to delivered next day?
  • Are you willing to relocate?
  • Are you comfortable with night shifts?

Students from other backgrounds were also questioned on their core subjects to check the extent to which their knowledge goes. Every domain is touched by the interviewers. Another important factor is what you mention in your resume. Always remember that you are your resume and beyond. Make sure you answer all the questions that are asked about your resume. Also, it is a good idea to mention things beyond your resume, but don't make it too much information.  A string of non-answers from anything in the CV will definitely not land that job. Make sure you know whatever you’ve put in your CV. Knowing more is a bonus but knowing less is not healthy for that prospective offer letter.


Check other Blogs on TCS Ninja Recruitment Process

TCS Ninja Technical Interview Tips and FAQ's 

TCS Ninja HR Interview Tips and Strategies 

TCS Ninja Exam Advanced Coding Questions 

TCS Ninja English Section Sample Questions

TCS Ninja 10 day study plan 

TCS Ninja Academic Eligibility Criteria

TCS Ninja FAQ's

Published in Test Patterns

Tips to ace the HR interview 

TCS Ninja HR Interview - The final door for you to get into the world of TCS. Wondering what's the key to open it? Right amount of confidence mixed with implementation of certain strategies and proper preparation. As much as you prepare yourself for this round, there would still be something you can be unsure of. This is a great channel for you to build an impression that you're confident and the best choice for the organization. Stress on your strengths and talk about why should they hire you. However, there is a suitable etiquette that you're required to follow in order to create that impression. Consider these points below while you attend an HR interview to create a positive impact.

Published in Tips & Strategies

TCS Ninja exam analysis of Slot 2&3 on September 2nd 2018.

The second and third slots of TCS Ninja National Qualifier Test, Day 2 are done too. We at Conduira Online, from authentic sources gathered exam details and made a detailed analysis of the test.

The exam pattern is same as what had been given in Slot 1. It consisted of 4 sections which are to be answered in 90 minutes. There is negative marking in every section in the ratio of 1/3.

Published in Test Patterns
Page 1 of 4

Vocabprep Banner

Please key in your e-mail address.

Be up-to-date with the happenings at Conduira!