YouTube Icon

Interview Questions.

TCS Interview Questions - Sep 08, 2021

fluid

TCS Interview Questions

TCS is a outstanding location to start as well as develop your profession. It offers a friendly and superb ambiance for each person and corporation boom. With operations in about 46 international locations, TCS recruits a large pool of applicants and the primary features they search for in a candidate are the potential and the attitude.

The manner

If you are a fresher, you will must pass thru 3 rounds of interviews – every now and then four. There might be a written check (flair test), organization discussion, technical interview and an HR spherical. TCS additionally opts in for phone interview for screening functions.

Are you from CS, IT or MCA history? Then you'll be requested questions about C, C++, OOPS, SDLC and perhaps Java. If not, you will be asked questions on your final year task and the technical understanding you acquired in the course of university days. They will ask you in case you are comfy with any programming language (perhaps C or OOPS) and ask you some fundamental questions. Be organized to jot down at least recursion, factorial, LCM, GCD, swapping numbers and palindrome programs apart from the list of questions we've got under.

Though they do prefer applicants with seventy five% or above, when you have a minimal rating of 65% without a arrears, you may practice for the interview.

If you are hopping from some other agency, you may have one or two rounds of technical interview followed with the aid of HR dialogue. There can be multiple interviewer and you'll be asked questions about various subjects from your resume.

Technical Interview Tips

While aptitude (written check) and institution discussion rather depend upon success too, the technical and HR rounds are completely for your manipulate. TCS interview questions are thorough and take a look at you for your principles in addition to coding capability. It is crucial to be nicely organized and do a little coding exercise before going for the written check/interview.

TCS Interview Questions

Here are a few common questions asked inside the technical round of TCS interview. Note that no longer all questions are from a unmarried interview. This list is a group of TCS Interview questions from distinct interviews.

Which is your favourite or strongest programming language?

Rather than preferred, mention the language you may be most at ease with because they'll ask you extra questions about the language you mention. It may be C, C++, Java, SQL or some thing of your choice.

Question-Related to SDLC

Question: What do you recognize about SDLC?

Answer: Software Development Life Cycle (SDLC) describes the complete manner of software development from its necessities evaluation to protection. There are five degrees – requirement analysis, layout, improvement, testing & deployment, and aid or renovation.

Question: Are you familiar with the numerous SDLC methodologies?

Answer: There are 6 fashions –

Waterfall model (maximum commonplace and conventional) – a sequential section through segment approach, for example, after the requirements segment, the design segment is taken up after which the subsequent and so forth.

V-formed – Same as the waterfall, but there's a trying out segment after every development segment.

Iterative – A brief manner to build the simple product. Even when entire requirements aren't known, you can start development. The system is repeated to improve and accommodate more requirements.

Spiral – Similar to iterative but lets in for greater refinement because the undertaking is going through all the tiers in a spiral until it's far whole.

Big bang – The improvement begins with minimum expertise of requirement, as a consequence calls for little making plans. It is appropriate only for small initiatives that contain much less chance.

Agile – Currently, the most favored approach, the project is added in phases, and the clients, developers, testers and onsite coordinators paintings in tandem. Each new launch is like a non-stop improvement over every preceding launch.

Check right here the Top SDLC Methodologies

Question-Related to HTML

Question: What is metadata? What is its reason?

Answer: Metadata shops records about the facts that the HTML report shops. This is completed using thetag. Metadata can keep statistics like keywords, page description, last changed date and can be used by browsers, net offerings, and engines like google.

Question: Write a easy HTML to get the username as enter and post the price entered.

Answer:

Username: 

You can provide an explanation for the primary tags like

 and the motion.

Question: Name few tags that don't need closing tags.

Question: What is a fashion sheet?

Answer: It is a record that describes the layout of an HTML file or internet web page. For example, the coloration of a text, margins, spacing, fonts, size etc, the entirety comes below stylesheet. The most common format is CSS (Cascading style sheets).

Question: What is a marquee?

Answer:

It is an HTML detail that causes textual content or picture to scroll up, down, left or right routinely. Example, a news flash where text movements horizontally on the display screen.

Question: Create a desk with three rows and a couple of columns with a black border.

Answer:


1	2
5	8
11	12

Question-Related to C

Question: Who evolved C?

Answer: C was initially developed with the aid of Dennis M. Ritchie.

Question: Can you write a application to locate if a range of is prime?

Answer: Check out the solution in this article.

Question: What is a dangling pointer?

Answer: A pointer that points to a unfastened or deleted reminiscence vicinity is referred to as dangling pointer.

Question: Is C platform independent?

Answer: C compiler has to be compiled in a different way for distinctive OS, as a result C is platform established.

Question: Explain the different garage instructions in C.

Answer: There are four storage instructions -

Auto - the default storage magnificence for variables declared inside a feature/block. Cannot be accessed outdoor the block or characteristic where they're created.

Register - the capability is equal as automobile, however the compiler shops sign in variables within the register of the microprocessor for quicker access. If no loose sign up is to be had, reminiscence space is utilized.

Static - these are declared most effective once and the cost is retained in the course of the scope.

External - the use of the extern key-word of external garage magnificence, permits the equal variable to be re-used and re-assigned. If a international variable has been assigned a value, that may be overwritten with the aid of using extern for the variable internal another function/block.

Question: Write a simple application to print the common marks of a scholar.

Answer: int marks[5] = ;

int length = sizeof(marks)/sizeof(int);
double sum = 0;
for(int i=0; i<length; i++)

double average = sum/length;
printf("Average marks = %lf", average);

Read about exclusive information sorts in C from this great blog.

Question: What is the distinction between struct and union data kinds?

Answer: In union, the whole memory area allotted to the union is the member with the biggest length. Space is shared with the aid of different individuals. The union can shop most effective one fee at a time. Structs can include one-of-a-kind forms of facts with out compromising on the reminiscence space.

Question: Explain the distinction between skip by using fee and pass by using reference using a simple software.

Answer: This specific weblog explains all about skip with the aid of fee and bypass with the aid of reference with simple examples.

Question: What are the records structures in C?

Answer: Arrays, stacks, queues, related lists and trees are the data structures in C. Read extra about records structures from this tutorial page.

Question: What are directives? What are ifdef, define and endif?

Answer: Directives tell the compiler to preprocess the code before compilation. These preprocessor directives start with the hash(#) image to signify the same. The most not unusual pre-processor directive is #include that we use in all our packages.

#ifdef and #endif – are conditional compilation directives that assist in compilation of sure code if the situation is satisfied. If now not, the precise code block will now not be compiled.

define - #define directive is used to define a macro in the program. For example,
#define LENGTH 3
LENGTH can then be used anywhere in the program.

Question: What do you mean by the ‘length of’ operator?

Answer: Size of operator returns the scale of an operand. The operand can be a statistics type or an expression. For instance, sizeof(int) will return four, that is the reminiscence allotted to integer data kind. Same manner sizeof(array)/sizeof(int) will return the length of the factors in an integer array.

Question: Consider a union as

union pattern

int a;
float b;
char c[6];
}u;

In the primary function, if you print the scale of the union, what's going to you get?

Answer – We gets the dimensions of the person array as that is the most area allocated to the union.

Question-Related to OOPS (Object Oriented Programming)

Question: Explain the principle concepts of OOPS.

Answer: The primary principles of OOPS are an abstraction, inheritance, encapsulation, and polymorphism. You can provide one-liner approximately each and whilst requested more, deliver greater details. Watch this video for a quick evaluate of OOPS concepts.

Question: What is the distinction between feature overloading and function overriding?

Answer: Overloaded features have the equal call however a distinctive quantity or kind of arguments. For instance,

float add(int a, int b);
float add(int a, int b, int c);
float add(float a, int b);

The actual approach to be referred to as is determined by way of the compiler for the duration of bring together-time based totally at the parameters which can be handed.

In function overriding a base, implementation is overridden by the kid elegance. During run-time, based on the kind of item instantiated, the appropriate method (child or figure) is referred to as. For example, if a parent magnificence A and infant magnificence B each contain technique displayInfo(), and the object is created as A a = new B(); the technique of B might be called.

Question: Do you already know any design sample based on the concept of polymorphism?

Answer: Factory pattern is one of the maximum common styles that uses polymorphism. You will discover this blog very beneficial in know-how factory sample in a easy way. You can also get the Head-First Design patterns book to recognize all of the design patterns (it's far a super thrilling subject matter).

Question-Related to C++

Question: What are some of the differences between C and C++?

Answer: This direct link will take you to some vital differences.

Question: What is modularity? How is it executed in C++?

Answer: A modular software is one which has been split into smaller modules, and each module performs most effective one venture (function) or a set of small capabilities/tasks. We can implement modularity the use of OOPS standards like encapsulation.

Question: Tell the primary distinction among bubble sort, merge type and insertion sort.

Answer: The interviewer received’t count on you to tell the complete set of rules. You have to just realize the standards and distinction.

Bubble kind – Simple sorting set of rules wherein  neighboring elements are compared at a time and swapped if the first is greater than second.

Merge type – Break the large array into smaller arrays of a single element. Now, type the arrays even as merging them.

Insertion kind – There are  arrays. Elements from the unsorted array are taken one at a time and inserted into the second one array in a sorted manner.

Question: What is a null pointer? How is it distinct from void pointer?

Answer: Null pointer is used for assigning the cost of null or zero to a pointer variable i.E. A pointer that isn't pointing to whatever. The variable may be of any records kind (int, char, float, long and so forth…). The void pointer does now not companion any statistics type. It can shop the deal with of a variable of any records kind.

Question: What is the use of pal function?

Answer: Friend feature of a category can access private and guarded contributors of the elegance.

If there are two lessons say Student and Teacher, and if Student magnificence’s getMarks() characteristic is asserted as a friend feature within the class Teacher, it may get entry to the non-public members of the elegance Teacher.

Question: How is reminiscence allocation achieved in C++? Is it the identical in C?

Answer: Using new() operator. In C, it is accomplished the use of malloc() and calloc() methods.

Question: What is the distinction between ++i and i++ operation?

Answer: If the ++ signal comes earlier than the index, the index is incremented first after which an operation is accomplished. If the ++ signal is put after the index, the index is incremented after the operation. For example,

int i = 0;
cout << ++i;
cout << i++;

both will print the value as 1.

Question: Explain linked lists and queues.

Answer: Both are data structures in C++.

Linked list – In a linked list, each element is linked to the next one using a pointer. The last element on the list points to null. The first element is called a head. Each element contains data and the link to the next element in the list. Watch this video to learn more about linked list.

Queue – Queue is a FIFO (first in first out) mechanism. It is similar to our line in ATM counter where the first customer goes in and comes out first. That means, when the queue is full, the oldest element is flushed out first.

Question: What is a pure virtual function?

Answer: Pure virtual function or an abstract function doesn’t have any implementation. We just declare it. The classes that are derived from the abstract class implement the pure virtual function. We can declare pure virtual function by assigning a value of 0 to it.

Question-Related to Java

Question: What is meant by platform dependence?

Answer: In some languages like C, the compilation of code depends on the operating system. That means the code built on one machine can work only on that type of machine and not anywhere else. This is called platform dependence. In languages like Java, the code can be built once and run anywhere irrespective of the OS or machine. That is why Java is platform-independent.

Question: Explain the difference between an interface and an abstract class.

Answer: A class can implement many interfaces (multiple inheritances) but can extend only one abstract class. Interface methods are not implemented. The implementation is up to the application developer. Abstract classes can have a default implementation of common behaviors.

Question: What are JVM and JIT?

Answer: Java code can be executed anywhere because the code is converted from Java bytecodes into the native code of a machine. This is achieved by the JVM (Java Virtual Machine).

A file is compiled only for the first time until it is changed later. If the byte-code is not changed, JVM, the intelligent processor will not waste time compiling such files again. This is called as JIT or Just In Time compilation.

Question: Is there a do-while loop in Java? How is it different from while?

Answer: Yes. In do-while loop, the condition inside while is checked after the statement is executed, hence the statements are executed at least once in the code, whereas in while, the condition is first checked and only if it is true, the statements are executed.

Question: Will this code compile?

byte a = 10;
byte b = 12;
byte result = a + b;
System.out.print(result);

If no, what should you do to make it work?

Answer: The statement will not compile. The result a+b has to be typecasted to byte as the default answer 22 will be an integer. The correct code will be –

byte result = (byte) a + b; or int result = a + b;

Question: What is the expected output of this code?

System.out.print("Hello");
System.out.println("World");

Follow up - What should you change to print both in different lines?

Answer: The answer is HelloWorld. We should use println method to print in a new line.

Consider an array as –

char [] str={'j', 'a', 'v', 'a'};

How would you print the individual characters of the array?

We can use the java.Util.Arrays.ToString(str) to get the desired result.

Question: What is a NullPointerException?

Answer: If we try to use a null value for any operations, java throws a null pointer exception. For example,

String str = null;
str.compareTo(“java”);

A dot operation will throw NullPointerException.

Question: How is garbage collection done in Java?

Answer: Java easily boasts of the in-built garbage collection done by the JVM. When new() operator is used, the garbage collector allocates memory space. If the object is no longer used, the garbage collector automatically frees up the space used by the object and reuses it for further allocation.

Question: Suppose there are two processes A & B, is there a way that they can send messages to each other?

Answer: Java processes can communicate with each other using threads. Threads enable multi-tasking by completing more than one tasks in parallel without interfering in each other’s data.

Few other questions from database and cloud (for those who know these) –

Question: What is a database schema?

Answer: Schema is a logical view of the entire database structure. It represents the distribution and organization of data and the relations between them through tables, constraints, primary and foreign key constraints and so on.

Question: What are the integrity rules defined in a DBMS?

Answer: There are 2 main types of integrity rules – entity integrity (every table must have a primary key) and referential integrity (foreign key is usually a primary key of some other table and can be null).

Question: Can you write a nested query?

Answer: You can write any nested query that you know. Here is one for example,

SELECT student_id,AVG(marks)
FROM students
GROUP BY student_id
HAVING AVG(marks)>
(SELECT MAX(AVG(min_marks))
FROM marks
WHERE subject IN
(SELECT subject_id FROM subjects
WHERE branch_id
= 'ECE')
GROUP BY subject_id);

so one can get the listing of students who got marks extra than average marks in all of the topics for the desired department.

Question: What is mutual exclusion?

Answer: Mutual exclusion is a way to prevent impasse by way of preventing get admission to to a resource through a couple of strategies on the same time (simultaneously). A thread holds a resource and it is locked. The other threads wait till the useful resource is launched.

Question: What do you already know approximately cloud computing?

Answer: Cloud computing is the supply of resources like records garage and computing necessities on-call for over the net. The records is centrally positioned in large facts centres so that it's miles usually to be had to the quit customers. All the offerings, infrastructure, software program and platform are to be had as offerings stored on a shared computing surroundings. Some most important gamers are AWS from Amazon, Azure from Microsoft and Google’s cloud platform.

For some of the subjective questions just like the ultimate one, you might recognise greater however stick with a short answer until you are asked for more information by the interviewer.

The questions can be tweaked but this is the general gist. The questions are elaborate and you need to be cautious about knowledge the questions genuinely. The interview could be of common difficulty degree and will test your concern understanding in addition to universal attitude closer to paintings. Once you clear technical round, you can be taken to every other technical spherical or an HR spherical. Some regular HR questions are –

Tell me the most thrilling element about your self.

General questions about your interests and pastimes.

What do you realize approximately TCS?

For this query, read through TCS website, their current achievements, their function within the worldwide marketplace and their vision and assignment.

Do you like programming? (If you aren't from CS heritage). Why did you choose IT line for profession and now not your center subject?

What are your strengths and weaknesses?

Can you work in shifts? Will you be able to relocate?

If your supervisor asks you to do a project you do now not like (or is towards your moral ideas), but guarantees you a hike or merchandising based totally on that, will you do it? If yes, why? If no, how might you keep away from it?

Do you've got any other gives in hand?

If you are the chief of your mission, what characteristics do you observed you need to own?

If the reputation of your undertaking is red (chance), how would you motivate your team to paintings greater without getting burdened out?

Some of those questions are subjective and there may be no proper or incorrect answer as long as you have got a justification for the same. These might be a check of your staying power, coping with stress and hard situations at work.

Final phrase

You will find masses of overwhelming information at the internet. Different candidates have distinct reviews and they percentage it at the net. But the key's to be well-organized with what you've got written on your resume and to accept in case you do not recognize any of the solutions. There is no shortcut to clearing TCS interview. If you don’t recognise one solution, don’t get nervous or pressured, the interviewers decide you on normal overall performance and no longer just one or  questions. Be sincere, be confident and most importantly, be cool, so that you can bear in mind the solutions you have prepared.




CFG