TCS Interview Questions - TCS Recruitment Process (2022) - Javatpoint
TCS Interview Questions - TCS Recruitment Process (2022) - Javatpoint
their final project and a single technology in which they are trained.
Academic Criteria
65 percent or above in B.Tech, Class X and XII.
Lifetime Free
Credit Card
A linked list consists of two parts: information and the link. In the single
connected listening, the beginning of the list is marked by a unique pointer
named start. This pointer does point to the first element of the list and the link
part of each node consists of an arrow looking to the next node, but the last
node of the list has null pointer identifying the previous node. With the help of
start pointer, the linked list can be traversed easily.
Abstraction lets you focus on what the object does instead of how it
does it.
3) What is inheritance?
//Base Class
class A
{
public int a;
}
//Derived Class
class B : A
{
a=15;
}
5) What is Polymorphism?
2. Operator overloading
Types of Inheritance:
1. Single inheritance
2. Multiple Inheritance
3. Multi-level Inheritance
4. Multi-path Inheritance
5. Hierarchical Inheritance
6. Hybrid Inheritance
The members of the class can have access specifier such as public,
protected, and private but members of the interface can not have the
access specifier, all the members of the interface is declared as public
because the interface is used to derive another class. There will be no
use to access specifies inside the members of an interface.
The methods inside the class are defined to perform some actions on
the fields declared in the class whereas interface lacks in asserting in
areas, the ways in an interface are purely abstract.
A class can implement any number of the interface but can only extend
one superclass. Whereas interface can reach any number of interfaces
but cannot perform any interface.
A class can have a constructor defined inside the class to declare the
fields inside the class, whereas interface doesn't have any constructor
defined because there are no fields to be initialized.
The JOIN keyword is used in an SQL statement to query data from two or
more tables, based on a relationship between specific columns in these
tables.
A view is a virtual table. A look contains rows and columns, just like a real
table. The fields in a picture are fields from one or more real tables in the
database.
You can add SQL functions, WHERE, and JOIN statements to a view and
present the data as if the data were coming from one single table.
Reference Key is the primary key that is referenced in the other table (linked
via the other tables Foreign Key). Foreign Key is how you connect the second
table to the primary tables Primary Key (or Reference Key).
17) What is the difference and similarity between C and
C++?
Btree
It is made of branch nodes and leaf nodes. Branch nodes hold prefix key value
along with the link to the leaf node and the leaf nodes contain the indexed
value and rowed.
Bitmap
It consists merely of bits for every single distinct value. It uses a string of bits
to locate rows in a table quickly. It is used to index low cardinality columns.
Clustered Index
Non-Clustered Index
int a[10];
This defines an array whose name is a and has ten elements from index 0-9
#include<stdio.h>
#include<conio.h>
void main()
{
int A[10]={'0','1','0','1','0','0','0','1','0','1','0','0'};
int x=0,y=A.length-1;
while(x
x++;
else if(A[y])
y--;
if(A[x] && !A[y])//here we are checking that stating index is having 1 and last i
A[x]=0,A[y]=1;
}
getch();
}
Abstraction is the basis for software development. It's through this concept
we define the essential aspects of a system. The process of identifying and
designing the ideas for a given system is called Modeling ( objectmodeling).
Three levels of data abstraction are:
3. View level: End users always work on view level. If any amendment is
made it may be saved by another name.
void swap(int &i, int &j)
{
i=i+j;
j=i-j;
i=i-j;
}
The calloc() function allocates a memory area; the length will be the product
of its parameters (it has two settings). calloc fills the memory with ZERO's
and returns a pointer to the first byte. If that fails to locate enough space, it
returns a NULL pointer.
A malloc() function allocates a memory area; length will be the value entered
as parameter. (it has one parameter). It does not initialize memory area
The free() function is used to free the allocated memory(allocated through the
calloc and malloc), in other words, this used release the allocated memory
new also used to allocate memory on the heap and initialize the memory
using constructor
int i=10;
printf("%d%d%d",i,++i,i++);
Answer= 10 12 12
Pure Virtual Function:- This is the function used in base class, and its
definition has to be provided in derived class, In other pure virtual function has
no definition in the base is declared as :
virtual void fun()=0;
It means that this function is not going to do anything, In case of pure virtual
function derived function has to
Asynchronous delegates
Styles
Templates
Animations
Databinding
29) Write a program in C to swap two numbers without help
of a third variable.
/*
* C++ program to swap two numbers without using a temporary variable
*/
#include<iostream>
using namespace std;
/* Function for swapping the values */
void swap(int &a, int &b)
{
b = a + b;
a = b - a;
b = b - a;
}
int main()
{
int a, b;
cout << "Enter two numbers to be swapped : ";
cin >> a >> b;
swap(a, b);
cout << "The two numbers after swapping become :" << endl;
cout << "Value of a : " << a << endl;
cout << "Value of b : " << b << endl;
}
// file name: Main.java
class Complex {
private double re, im;
public Complex(double re, double it) {
this.re = re;
this.im = im;
}
}
// Driver class to test the Complex level
public class Main {
public static void main(String[] args) {
Complex c1 = new Complex(10, 15);
System.out.println(c1);
}
}
public class Prg {
public static void main(String args[]){
System.out.print("A" + "B" + 'A');
}
}
public class Prg {
public static void main(String args[]){
System.out.print('A' + 'B');
}
}
public class Prg {
public static void main(String[] args) {
char [] str={'i','n','c','l','u','d','e','h','e','l','p'};
System.out.println(str.toString());
}
public class pg {
public static void main(String[] args) {
System.out.print("Hello");
System.out.println("Guys!");
}
class Test2 {
ublic
static void main(String[] args)
{
byte x = 12;
byte y = 13;
byte result = x + y;
System.out.print(result);
}
#include <stdio.h>
union test {
int x;
char arr[8];
int y;
} u;
int main()
{
printf("%u", sizeof(u));
return 0;
}
I want to work in an organization where I can develop the skill set gained from
my Educational background as well as develop skills which will benefit
throughout my career as regarding this job, this job is entirely connected with
my domain of expertise, and also it helps me to enhance my communication
skills which have been on my to-do list. So I want to get associated with such
a big organization and also improve skill sets that I have always been wanting
to upgrade.
3) Describe an experience of yours wherein you were asked to do
something which you didn't like to do and how you handled it?
This is a typical question which tests your presence of mind and your
communication skills. Gather any instance from your life and speak on
that.
I have many life instances where I had to perform tasks which I did not like
performing but as these tasks were mandatory hence backing off was not an
option I could afford. One such memory I would like to share was from my 9th
grade when we had to study Sanskrit as our school did not have option
between Hindi and Sanskrit after class 9th so initially I did not care about this
subject but when I started researching it I found that this subject is quite
complicated and also I realized that I was not all good at remembering things,
hence this subject became a difficult task for me but as I told backing off was
not an option so I decided to take help from my parents, friends and other
reliable sources and worked hard throughout the remaining time and at last
the hard work paid off though I did not score excellent marks I achieved
marks which I could not have believed I could score a few months back.
Though this answer is objective and can be different for different persons but
remember be positive in your thoughts and do not say many things about the
company which gives the interviewer an illusion that you are exaggerating.
I have from a long time wanted to work with an IT company which treats its
employees in the best way it can. I have always wanted to work with an
organization which provides a very comfortable and home like work
environment and when it comes to TCS I find that both the requirements are
fulfilled. Even requirements I can hardly imagine are met, most importantly I
get the opportunity to learn and enhance my skill set to become a better
professional in the future.
Remember this answer requires a clear-cut reply and wants to know as the
company might provide time to time travel hence do not try to be good and if
you are not able to change places tell them explicitly if they have any
positions for that kind of post they will consider you. Also, refer to the sample
answer given below.
Yes, as part of growing up I used to travel a lot as my father is an ex-
serviceman hence occasionally he used to be posted throughout the country.
Though I would prefer my city as it helps me live with people, I care about, but
at the same time, I am ok with relocating.
You can tell unique things about your states; this may consist of things which
you might or want to improve, as a said before stick to being realistic.
Delhi is one of the busiest cities in India and though I do not have any
knowledge of towns outside India hope it will also be the most active of all.
Delhi like Mumbai never sleeps and in Delhi, as we know have lots of places to
wander and explore. Also being central to many states and the Capital of India
it is the center of attraction for many, and hence due to constant migration, we
find a variety of people residing in Delhi. Also, Delhi has all kinds of markets,
and also it has hospitals and facilities which are top notch and can be
compared to best across the globe. Hence, living in Delhi is like a dream come
true.
By this question, the interviewer wants to check whether you can cope with
on-the-spot situations, take some time gather your thoughts and speak up.
The most memorable day of my life would without any second thought be the
day when I passed my graduation. That day I felt like now I can get a
respectable job lead an independent life and slowly and steadily I have turned
from a dependent boy to independent man. I am now mature enough to take
my life decisions and decide what is right for me and what is not. That day I
realized why my grandfathers and old people are so nostalgic and have so
many memories associated with the Independence of our country and such
small word independence could have such massive meaning attached to it.
Never tell strengths which you cannot prove on the spot. And speak only the
forces that are true.
Though this is a tricky question but doesn't be the bait, i.e., the interviewer
wants to know your weakness but tell him weakness such that they are also in
some way your strengths.
Though it is difficult to see your weakness yourself as we all know the general
human tendency is to shift the blame and never take the responsibility for
some wrongdoing. But to be honest, I find that when I want to achieve
something, I work hard to get that though it might not be worth it to work so
hard for the happiness that I get after attaining I work hard, so in the
meantime I miss out on another event concurrently happening.
The requirement for this job completely matches my skill set, as a candidate I
have experience working in this domain which might be beneficial for the
organization as well as me. Also, I am a quick learner and a team player so
the organization won`t have to spend much time and resources on me. Even
when I work, I work for the maximum benefit of the organization. Moreover, I
would gain exposure to the industry which will be very beneficial to my career.
Again...Be realistic
It was a very significant decision I would say, but not that great on the
implementation part.
The objective was not met entirely as not many people having black
money were caught.
All in all, there are many positives and negatives in this action hence to
reach a conclusion would not do justice.
Nowadays, I have quite a hectic schedule, and I have long been reaching out
for a holiday or break, but as you ask I would describe my routine as:
I wake up at 0700hours. I perform all my daily chores and get ready to leave
for office at about 0800 hours. I commute by metro, and then I reach my office
at an estimated time of 0930 hours. I work there till 1300 hours and then we
have a half an hour break, after the break, we get back to work, and I have a
Java class from 1530 to 1700, and after completing the course, I work for
about 90 minutes, and at 1830 hours I depart for home. Again my house is 90
minutes ride in metro, and by 2000 hours I reach home and watch a great
movie and by the time the film is finished I am off to sleep and the day is
finished and next day again back to work.
14) Mention any five qualities that a person should have for
this profile?
You can tell about your work experience, and why left it but don't give any
negative answer as they have a negative impact. Answer like for growth, for a
better opportunity, to enhance your skill set further.
You can tell your hobbies. You must prepare for questions from your hobbies.
There are many qualities that a leader should have but to name a few, a leader
should be able to coordinate a team, he should have excellent understanding
of people and their behavior at different points of time, he should be able to
find people he can depend on, he should be able to be distinguished in a
crowd of people, he should be able to instruct a group of people, he should be
dominant and many more are there.
No