50+ TCS Interview Questions And Answers (Bookmark Them!)
Table of content:
- List of TCS Interview Questions - Technical
- TCS HR Interview Questions
Tata Consultancy Services or TCS, is a leading company that provides IT consulting services and digital and business solutions to its clients. With over 500,000 employees across 46 countries, TCS has become one of the largest multinational IT service and consulting companies. It is headquartered in Mumbai, India.
TCS hiring process includes four rounds of interviews:
- Written exam (Logical reasoning, Verbal ability, etc.)
- Technical interview
- Managerial interview
- HR interview
Feeling anxious about your interview preparation? Here's your magic pill! Practice with Unstop and step closer to your offer letter.
In this article, we will help you revise important topics for the TCS technical interview round. Let's begin.
List of TCS Interview Questions - Technical
These TCS interview questions aim to assess your technical knowledge and programming skills. Please note that
- Interviewers may also ask about your academic projects.
- These TCS interview questions are helpful for both fresher candidates and experienced candidates to brush up on their technical subject knowledge.
1. Explain SDLC?
SDLC stands for Software Development Life Cycle (SDLC). It represents software development from the stages of the requirement analysis to maintenance and support. The entire process comprises seven steps:
- Analysis
- Planning
- Definition
- Design
- Development
- Testing
- Deployment
- Support
2. What do you mean by the waterfall model?
The waterfall model divides project activities into two sections, beginning and end. This division is similar to the top and bottom of a waterfall. However, in this model, one stage always precedes the other. In other words, it is a traditional software development lifecycle approach that progresses linearly through distinct phases, with each phase building upon the results of the previous one.
3. Name the most popular SDLC model.
Presently, the most popular model is AGILE. The main reason for its popularity is the low error probability during production. In AGILE, you use the continuous iteration methodology to reduce errors.
Note: SDLC is an important topic that aspirants should not skip while preparing the TCS interview questions.
4. List the essential differences between C & C++.
This is a very common TCS interview question asked to assess your C and C++ knowledge.
C | C++ |
A procedural language; no class concept, objects, inheritance, encapsulation, and polymorphism | It uses Object Oriented Programming System (OOPS). It has polymorphism, encapsulation, inheritance, and class concepts. |
Malloc() and calloc() functions do the dynamic memory allocation. | The new operator does the memory allocation. |
There is no operator and function overloading in C. |
You can overload functions and operators in C++. |
You cannot run C++ code. |
You can run C code. |
Input and output are through scanf and printf. |
C++ uses cin and cout for input and output. |
You can handle exceptions. |
You cannot handle exceptions. |
Learn more about TCS recruitment? Get mentorship from experts who have been a part of TCS!
5. Name some differences between C++ and JAVA.
Java is an object-oriented programming language similar to C++. However, there are some differences.
C++ | JAVA |
It is a platform-dependent language. | It's a platform-independent language. |
It is primarily used for system programming. | It is primarily used for application programming. |
You can use pass-by-value and pass-by-reference for variables. | You can only pass variables by the value. |
You can write blocks of code explicitly for pointers. | There is only limited support for pointers in Java; you can only use them internally in a program. |
You can overload the operator. | You cannot use operator overloading. |
There is support for multiple inheritances. | You cannot have multiple inheritances in JAVA. |
6. What is OOPS, and how does C++ use it?
OOPS stands for object-oriented programming that considers everything as objects while designing a program. It increases the ease of programming. Its basic principles of object-oriented are:
- Class: It contains methods and variables. Using a type, you can create objects. It is declared using a class keyword.
- Inheritance: You can create parent and child classes, where a child class has some of the properties of the parent class. It is similar to biological ones, where progeny shares traits with their parents. The different types of inheritance are Single inheritance, multiple inheritance, multi-level inheritance, hierarchical inheritance, and hybrid inheritance.
- Polymorphism: You can create the same objects with different jobs. For example, you can create multiple functions with identical names. It occurs when there are many classes with the same parent class. You can achieve polymorphism using function and operator overloading.
- Abstraction: You can hide what an object does and show only what the thing is. You do this because every user may not need to know how an object works. It is similar to how a consumer doesn't need to understand how a laptop works to use it.
- Encapsulation: It is the concept of hiding code and data in a single unit. For example, variables and methods may be inaccessible outside the class holding them.
Note: Considering the importance of this topic, TCS interview questions can be centered around OOPs. Click here to for some important OOPS interview questions
7. How can you differentiate between Structs and Classes?
Struct refers to a custom data type that has public members by default. Therefore, for private structs, we need to use a modifier. Likewise, classes have private members by default; you need to use a modifier to make public members. Another difference between the two is that you can inherit a class but not a struct.
Read more about structs and classes
8. What are pointers?
Pointers store the address of variables. You can use them to pass variables by reference using their addresses.
For example:
int a = 23;
int *ptr = &a;
cout<< ptr;
In this example, ptr has the a's address. So, by writing *ptr, we get the value that the pointer refers to, 23.
9. Differentiate between a reference and a pointer.
Pointer stores the address of a variable, whereas reference is only a variable's copy having a different name.
You need to initialize a reference, but you don't need to do that in the case of a pointer.
For example,
int a;
int *ptr = &a;
int a = 20;
int &ref = a;
The above example shows a pointer and a reference. The ptr will store a's address, and the ref will store the value.
10. Describe virtual functions.
If you mark any class function as virtual, its implementation is exclusive to the parent object. Any inherited class must have its definition of the virtual function. For example, if a class student has a function Uniform as virtual, an inherited class Headboy must define its function Uniform.
Virtual functions are those functions that an inherited class must override.
11. What are the examples of data structures in C++?
There are two types of C++ data structures:
- Linear: Here, you store data elements in a sequence. A stack, ques, and a linked list are some examples.
- Non-linear: These are not sequential, for example, a tree and a graph.
12. What is the disadvantage of using C++?
The main two disadvantages of C++ are that there is no built-in support for threads and it doesn't have garbage collection.
13. Define friend functions and classes.
A friend function is a function that is not a member of a class but is granted access to the private and protected members of that class. This access allows the friend function to manipulate or retrieve data from the class. Friend functions are often used when an operation involves multiple classes but doesn't naturally belong to any one of them as a member function. For example:
A friend class is a class that is granted access to the private and protected members of another class. This means that the friend class can directly access the private and protected members of the class it is friends with. Friend classes are often used when two or more classes need to collaborate closely, sharing data and operations.
14. How can you implement polymorphism in JAVA?
You can overload a method, also known as static polymorphism. Here, a method can have the same name but different parameters. The computer finds the appropriate method by the parameter list.
For example:
Overriding or dynamic polymorphism - Here, the appropriate method gets called at the runtime. For example,
The output will be 'IndianDoughnut, fresh dough ready' in the above example. Here, the method prepareDough() gets overridden by IndianDoughnutshop during runtime.
15. Differentiate between stack and heap memory.
- Heap Memory: Java Runtime Environment (JRE) allocates heap memory for objects and JRE classes. Additionally, heap memory does the garbage collection, and you can globally access the objects created on the heap.
- Stack Memory: You use this memory for short-term references, including references to heap objects. A new memory block gets created when the program calls a method; after execution, another program uses the block of statement.
16. Write a program to check for the prime number.
The below program uses several if-then statements to check for the prime number.
17. Explain inheritance with an example.
In inheritance, you can create a child class of a class. By doing this, the child class can access the methods of the parent class.
For example,
class A{}
class B extends A{}
interface c{}
class D extends A implements C{}
18. Explain the process of exception handling in C++ and Java.
Both C++ and Java use try/catch algorithms to handle exceptions. There are, however, significant differences.
- You can only throw exceptions for a Throwable class or its subclasses in Java. However, in C++, you can throw even primitive types and pointers as an exception.
- Java has a final block executed after throwing an exception; there is no such block in C++.
- The keywords are different for C++ and Java exception handling. Java uses 'throws'; C++ uses to throw.
- You can only have unchecked expressions in C++. Java can have both checked and unchecked expressions.
Note: Besides TCS Interview questions, most leading firms frame their technical interview questions on languages like Java. Here are some frequently asked Java interview questions.
19. Explain null objects and the memory allocation for them.
Null is the name given to a situation when a non-primitive variable doesn't point to any object.
- To declare null, you can use String str=null;
- To find null, you can use if(str==null);
- To throw NullPointerException, you can use int length = str.length();\
20. Differentiate between an Array and an ArrayList.
ArrayList is dynamic, whereas an array has a fixed length. Another difference is that one cannot store primitives in ArrayList, but it is possible in Array.
Read More: Understand the advantages and disadvantages of array.
21. Write a program to swap two numbers.
Following is a program to swap two numbers.
int temp = 0;
temp = number1;
number1 = number2;
number2 = temp;
22. Write the above program without using a temporary variable.
Following is a program that doesn't have a temporary variable.
number1 = number1 + number2
number2 = number1 - number2
number1 = number1 - number2
23. Define circular linked list.
In a list, each node connects to the previous node. In a circular linked list, the last node connects to the first node; this completes a circle.
24. List different modifiers in Java.
Modifiers in Java are:
- Public
- Private
- Protected
- Default
25. Define class and create an object for a static class.
In a class, you can integrate both variables and methods. For example, a Class Teacher can have all the details of a teacher, such as a name, teaching subject, etc. If an application wants a teacher's particulars, it fetches an object of this class.
You can create an object of a class Teacher, using Teacher teacher1 = new Teacher();
You cannot have static outer classes in Java; only the nested class can be static.
public class Outer {
public static class Neste {
}
}
You can create an object of static class as follows -
public class Test {
Outer.Nested obj = new Outer.Nested();
}
26. How many types of loops are there in Java?
Java has three types of loops:
- For loop
- While loop
- Do while loop
27. What are constructors and destructors?
A constructor is a method for initializing an object with the class's name. On the other hand, a destructor deletes extra resources of an object; it gets called automatically after the object is out of the scope.
28. What is a database schema?
A logical representation or structure of the entire database is the Schema. It tells you how the database organizes, associates, and stores data. Suppose it is a rational database, then the organization is in the form of database tables. A database schema is a series of formulas known as integrity constraints imposed on a database.
There are two types of Schema:
- Physical
- Logical
Physical Schema describes the arrangement of data at a physical level (HDD, SDD, etc.)
Logical Schema describes the arrangement of data at a logical level where programmers and database administrators work.
29. Define RDBMS.
RDBMS is the abbreviation of Relational Database Management System (RDBMS). lt has a set of programs for the developer to interact with the database. For example, it allows them to create, update, or delete data. For doing this, they use SQL queries.
Please note: RDBMS is an important topic for TCS Interview Questions
30. Define Unique Key, Foreign Key, and Primary Key.
- Unique key: It is the set of one or more keys for identifying a database record. It does not include a primary key, and it can have a null value. For example, teacher_name and Salary can remember the teachers with top salaries.
- Primary Key: It refers to each row in a table, also called as parent table. For example, teacher_id may be the primary key for accessing a teacher's id in a teacher table. It can't be null.
- Foreign Key: A column in a table establishes a relationship with another table by referencing a column. You can use the primary key of one table as a foreign key for the other, and it is also called a child table. For example, the textbook table can have teacher_id as a foreign key that determines the teacher's textbooks.
31. Define clustered indexes
Indexes improve the query time. It is similar to a book index that makes navigation easier. A clustered index has an order of the table data. For example, consider a clustered index of the teacher_id column, the teacher with the teacher_id 6 gets stored in the sixth row. It doesn't matter how you inserted the data in the table.
32. Explain SQL joins and their use.
You can use SQL joins to get results from multiple tables into a single table using primary and foreign keys. For example, consider the following table.
Table – teacher | table - books |
teacher_id (primary key) | book_id (primary key) |
teacher_name | book_title |
teacher_batch | teacher_id (foreign key) |
teacher_department | book_author |
You just need to post a query to get the book names a teacher has taken. elect teacher.teacher_name, book.book_title from teacher, book where teacher.teacher_id = book.teacher_id;
The results will be as follows:
teacher_name | book_title |
Madhuri | Java for beginners |
33. What is a leaf node?
The index's bottom-level node is a leaf node. It contains data pages of the underlying table in a clustered index.
34. Difference between tags and elements in HTML.
HTML tags define the starting and ending points of HTML elements. For example, you can create a heading element using the starting tag <h1> and the closing tag </h2>
35. What are attributes in HTML?
Attributes are used to specify the properties of the elements further. For example, <p align = "center"> HTML</p> has tag <p> and </p>, and the <p> tag has the attribute align = "center".
36. What do you mean by collapsing white space? What is its advantage?
HTML treats blank spaces as single-space characters. The developer does not have to worry about multiple spaces as the browser collapses them into a single one. Collapsing white space improves readability.
37. Define HTML Entities.
Some characters, such as '<', '>', '/', etc., are HTML entities. We need them to create the structure for an HTML block of code. You can see below a table of reserved characters.
Character |
Entity Name | Entity Number |
---|---|---|
< | < | < |
> | > | > |
& | & | & |
(non-breaking space) E.g., 10 PM | Eg. <p>10  PM</p> |   |
38. Differentiate between a stack and a queue.
A stack has a linear structure where you can insert elements from only one side. That side is the Top; it follows the Last in First Out or LIFO principle. The element that gets into the stack last gets out first.
A queue is also a linear data structure where you can only insert elements from one side. However, you can only remove objects from the other side of a queue. It follows the First in First Out or FIFO principle.
39. What do you mean by a Binary Search Tree?
A Binary Search Tree is a data structure with the following properties:
- You can only have branch nodes, which hold prefix key values, with keys lesser than the node in the left subtree.
- In the right subtree, you can have branch nodes with keys greater than the node's key.
- You can't have any duplicates.
- The subtrees must also be binary search trees.
40. What is bubble sort?
This sorting algorithm compares two neighboring variables. If the first one is larger than the second, the values get swapped. This process continues for all the elements, and the sort will use several conditional expressions and loops.
41. What do you know about cloud computing?
Cloud computing uses hardware and software resources over the internet. It has three main categories: software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS). IaaS gives you the most control, and you only pay for the infrastructure. You have to install and maintain the software yourself.
42. Define directives, ifdef, and endif.
Before compiling, directives tell the computer to process the block of code. As these precede coding, a more specific name would be the preprocessor directive. They start with the hash(#) symbol. The most familiar one is #include used in C++.
#ifdef and #endif are conditional compilation directives that check a code block for conditions before compiling. If not satisfied, the code block will remain uncompiled.
43. Explain JVM and JIT.
JVM is the Java Virtual Machine that converts Java bytecodes into the native code of the machine. Java Virtual Machine enables Java to be platform-independent and provides class libraries.
JIT is Just In Time compilation that tells Java Virtual Machine not to compile the unchanged code the second time. This process saves compilation time.
Together, JVM and JIT form the Java Runtime Environment or JRE.
44. What are the storage classes in C?
- Auto: This class is the default storage class for variables declared inside a function or a block. Tasks outside the block cannot access them.
- Register: It is the same as auto. However, the variables get stored in the microprocessor's registers for faster access. If the registers are not available, it stores the variables in the memory space.
- Static: These variables don't change their values once declared. They remain the same throughout the scope.
- External: This storage class allows the compiler to reuse a variable. You can overwrite a global variable using this class.
45. Define metadata and explain its purpose.
Metadata is the information about the data that an HTML document stores. For example, it can store keywords, page descriptions, etc. Browsers, search engines, and services can access this information.
46. Explain RR scheduling arguments.
RR stands for Round Robin; RR scheduling arguments are helpful for a time-sharing system. It consists of a CPU Scheduler that allocates CPU to various tasks for a particular time.
All processes get an equal share of CPU; however, you might need to face low throughput, larger waiting time, context switches, and response time.
47. How to avoid memory leaks in C++?
A memory leak happens when developers dynamically allot memory and forget to deallocate. The incorrect use of the delete operation is the most common cause of memory leakage.
To avoid memory leaks:
- Instead of manual memory management, use smart pointers, for example, instead of char*, use std::string
- Never use raw pointer unless you are operating on an old library
48. What do you mean by concurrency control?
Concurrency control is the practice of controlling multiple operations without interfering. It helps complete database transactions within time and without errors.
DBMS uses a concurrency control mechanism for the following reasons:
-
-
- Achieving isolation
- Resolving read-write and write-write conflicts
- Maintaining database consistency.
- Tracking the interaction of concurrent transaction
-
49. Tell the name of different access specifiers in C++.
The different access specifiers in C++ are:
- Public: Other classes can access the data members and member methods that have been made public. Using the dot operator with the class object, they may be accessible from anywhere in the program.
- Private: The data members and member functions that are declared private cannot be accessed or viewed from outside the class. They can only be accessed from within the class.
- Protected: The data members and member functions that are declared protected are similar to private members, but they can be accessed in inherited classes.
50. What do you mean by pass by reference?
Pass by reference is a concept in C++ where a reference or pointer to a variable is passed as an argument to a function instead of making a copy of the variable in memory address. Any changes made to the parameter inside the function are reflected in the original variable outside the function when a variable is passed in by reference because the address of the variable is saved in a pointer variable inside the code.
51. Tell the full form of ACID rule.
ACID rule stands for Atomicity, Consistency, Isolation, and Durability. It is a collection of characteristics that ensures the accuracy of data in database transactions in spite of mistakes, power outages, and other crises.
52. What is a generic pointer?
A generic pointer, also known as a void pointer, is a pointer that does not have any associated data type. It can hold the address of any data type, but it is not associated with any specific data type. When we are unsure of the data type of the variable that the pointer points to, we use the generic pointer.
53. What is dynamic testing?
Software testing that involves running the program and assessing its performance is known as dynamic testing. It is also known as functional testing since it focuses on analyzing how the software operates and how it responds to different inputs and situations. Static testing, which analyzes the software's code without running it, is the reverse of dynamic testing.
TCS HR Interview Questions
Here are some of the commonly asked TCS HR Interview questions and tips on how to effectively respond to them and show your communication skills.
1. Introduce yourself
This question is usually one of the basic interview questions. Your answer should highlight your skills, interests, qualifications, achievements, etc. Additionally, the response must have something they can't read from your resume. Try to be authentic instead of reciting a mugged-up answer.
2. Can you tell me about your strengths and your weaknesses?
Your answer should be natural. Hence, go prepared with 3-4 strengths and weaknesses. Support your answer with real-life examples. And while talking about your weaknesses, don't forget to add the efforts that you are making to overcome them.
3. Why should we hire you?
It would be best to tell the interviewer about your skills and how you can be a valuable asset to the company. This answer should be well thought out. Hence, to answer this, you need to understand the company's objectives by going through its website or social media accounts.
4. How do you cope with the pressure?
Your real-life experiences must support this answer. It would be best to tell the interview panel about times you faced work pressure, and things you did to manage them and deliver the task within the deadline.
5. Why do you want to join Tata Consultancy Services?
It is one of the most common TCS interview questions. The interviewer want to assess if you are a serious candidate who actually wants to be a part of the company culture. So, to successfully answer this, you need to understand the history and culture of TCS. This will help you align your answer with the objectives of the company and will also reflect your keen interest in TCS.
6. Can you take up rotational shifts?
Answer this question depending on your preference. However, a yes will improve your chances of getting the job.
Interviews are an inevitable part of the job hunt. From basic questions to in-depth technical ones, one has to be prepared to take on everything. But you can easily clear every round if you prepare well. The above TCS interview questions will certainly help you in this regard and thus enhance your confidence. All the best!
Suggested Reads:
Login to continue reading
And access exclusive content, personalized recommendations, and career-boosting opportunities.
Comments
Add comment