TCS Digital Previous Year Questions
TCS Digital Placement Papers - Download PDF
Join Our telegram group to ask Questions
Click below to button to join our groups.
TCS Digital English Questions
The TCS Digital English proficiency section consists of 10 questions, which needs to be answered in 15 minutes. Some of the previous year TCS Digital questions from English section are as follows.
1) Identify the option that contains the correct sequence from the sentences below, to make a paragraph:
A. Others believed that the strands became electrostatically charged and in doing so, allowed the spiders to ride Earth’s natural electric fields.
B. Darwin reasoned that the spiders must have flown at least 60 miles before reaching the vessel.
C. In October 1832 a young naturalist named Charles Darwin watched with delight as hundreds of tiny spiders dangling from short silk threads floated on to HMS Beagle as the ship made for Buenos Aires.
D. Some scientists said the spiders’ silk thread caught the wind and bore them aloft.
Options:
a) C, D, A, B
b) A, D, C, B
c) C, B, D, A
d) C, A, B, D
Answer: c
2) Identify the option that gives the appropriate and full meaning of the highlighted word in the sentence below: Football experts now agree that they had failed to reckon with the skill and strategies of the Croatian football team.
a) to settle the final accounts
b) to take into account
c) to count and calculate
d) to detect and understand
Answer: a
3) Identify the correct option to fill in the blank and complete the sentence:
____________________________________________________________, countless studies have proved that being outdoors and in contact with nature is beneficial for both physical and mental health.
a) To reducing blood pressure from alleviating symptoms of depression
b) By reducing blood pressure to alleviating symptoms of depression
c) In reducing blood pressure to alleviating symptoms of depression
d) From reducing blood pressure to alleviating symptoms of depression
Answer: d
4) Perspective meaning
a) Outlook
b) point of view
c) viewpoint
d) position
Answer: c
5) Proxy war meaning
a) state of war
b) hostility
c) biologic attack
d) War fought by two powers by using a supplement country in between.
Answer: d
——————————————
TCS Digital Aptitude Questions
TCS digital aptitude section consists of 12 questions to be solved in 30 minutes. Some of the previous year TCS digital placement papers questions are:
1) Brinda and Shanti run in the opposite direction on a circular track starting at diametrically opposite points. They first meet after Brinda has run 100 meters. They next meet after Shanti has run 150 meters past their first meeting point. Each girl runs at a constant speed. What is the length of the track in meters?
Answer: 350 m
Explanation:
Let the length of the track be x. When they meet at the first meeting point, Brinda has run 100 meters, while Shanti has run x/2 – 100 meters. By the second meeting point, Shanti has run 150 meters, while Brinda has run x – 150 meters. Since they run at a constant speed, we can set up a proportion:
Distance covered by Brinda during first Meet/Distance Covered by Shanti during first meet = Distance covered by Brinda during Second Meet/Distance Covered by Shanti during the second meet
100/ (x – 150) = (x/2 – 100) / 150
We get, X = 350.
2) Six bags contain 18, 19, 21, 23, 25 and 34 marbles respectively (some marbles are chipped). All the chipped marbles are in one of the 6 bags. The other remaining bags contain no chipped marbles. Ria takes three of the bags and Ruhi takes two of the others. The chipped marbles bag remains unselected. If Ria gets twice as many marbles as Ruhi then, how many chipped marbles are there in the bag which they have not been selected?
Answer: 23
Explanation:
The only combination when Ria has twice as many marbles as Ruhi as they pick three and two bags respectively is when Ria picks the bags with 34, 25 and 19 bags, while Ruhi picks the bags with 21 and 18 marbles.
The bag left out has to be the bag with chipped marbles.
Thus, there are 23 chipped marbles.
3) A and B stand at distinct points of a circular race track of length 135 m. They cycle at a speed of a m/s and b m/s. They meet for the first time 5 secs after they start the race and for the second time 14 seconds from the time they start the race. Now if B had started in the opposite direction to the one he had originally started. They would have met for the first time after 60 seconds. If B is quicker then A, then find b?
a) 8
b) 6
c) 7
d) 11
4) The length, breadth, and height of a room are in the ratio 3:2:1. If the breadth and height are halved while the length is doubled, then the total area of the four walls of the room will:
a) decrease by 15%
b) decrease by 18.75%
c) decrease by 30%
d) decrease by 13.6%
5) 1 ,7 ,8 ,49 ,50 ,56 ,57 ,343 ,344 ,350 ,351 ,392 ,393 ,399 ,400 ,……..
The above sequence contains sums of distinct powers of 7 in the increasing order (7^0, 7^1, 7^1 + 7^0, 7^2, etc). What is the value of term number 36?
a) 16857
b) 16863
c) 16856
d) 16815
TCS Digital Lateral Thinking Questions
TCS digital lateral thinking section consists of 7 questions which need to be solved in 30 minutes. So you will get roughly 4-5 minutes to solve each question of this section. This means the difficulty level of the questions is also expected to be high. Some of the questions in this section from TCS digital placement papers are:
1) The words Ocean and Cube can be related through a set of words/phrases in a specific order (path) as given here: Ocean, Water, Ice, Ice cube, Cube
In a similar way, relate Alert and Timeline.
- The score increases if you can relate them in more than one way.
- A shorter path gets a higher score than a longer path.
- Use new-line between paths. Use a comma between phrases in a path.
Possible solution: Alert, facebook, timeline
2) Words night, wrist, and stop can all be linked to watch. Similarly, what is the fourth word linking the following words Cottage, Swiss, Cake
———–
3) Given the picture,
one may visualize a pencil, a tower, or a rocket and so on. What comes to your mind when you see the following picture?
The more answers you give (that are suggested by this picture), the better.
Possible answers: Bacteria, Lemon with pins
4) The following note gives one part of a position paper on the future of Life Science. Please read the passage, and identify which of the indicated technologies would be useful for these trends strictly based on the passage. Note that more than one technology may be applicable
Life sciences companies are focusing on keeping patients digitally informed with accurate medical information on diseases, related drugs, and devices through microsites, mobile apps, and informative videos. Rather than replacing healthcare providers (HCPs), the digital medium will complement the quality of healthcare available for patients. Platforms or patient healthcare portals such as ChARM PHR help users manage not just their personal health records and medication history but also care plans, immunization records, health and wellness tips, and so on. patients like me and other such patient networking portals connect people with similar medical conditions and help them better understand medication regime, side effects, and cost impact, among others.
In such patient networks, some members are key influencers or ‘digital opinion leaders’. Life sciences companies can collaborate with these community leaders to share their opinions and information related to new therapies, trials, and care methods with others. Social networking sites can also provide information on specific campaigns to access drug vouchers, coupons, health-tips, and so on. Companies are leveraging social media channels by creating community pages for disease condition information well within the required compliance and regulation. Unimetric’s report on pharma-social-media-trends states that most of the pharmaceutical companies are active on five out of six social networks with the majority preferring Twitter, LinkedIn, Facebook and YouTube. MerckEngage is one such communication channel available across social media.
Digital technologies are now being leveraged to reduce medication non-adherence too with mobile-based trackers and schedulers, sensor-based devices such as inhalers, smart pillbox, and smart pills. Sensor-enabled medical devices such as oximeter and blood glucose monitor are capturing vital health stats for patients using their smartphones. These are transmitted to physicians and care teams, who provide patient-specific recommendations.
The selected technology ids (a,b and so on) needs to be entered in the blank area separated by commas. For example, if you think only a and h are valid, the answer line should be a, h
——————————
5) Construct the English words for minimum length Four using the characters of the word operations. (This was a Fill in the Blank type question where a user needs to feed the data in the given blank.)
Possible answers:
- Atropine
- Operant
- Painter
- Pointer
- Repaint
- Portion
- Stoner
- Enroot
- Option
- Parent
- Retain
- Proton
6) For example suppose one cluster is a, b, c, d, p the second cluster is b, m, e, g the third cluster is o, f, j, n, and the (unrelated) cluster is h, i, k, l, then the corresponding output could be (the first three cluster can be in any order).
- b, e, m, g
- o, f, n, j
- a, c, d, p
a) Pyramids of Giza |
b) Kochi |
c) red |
d) black |
e) great wall of China |
f) Mumbai |
g) Colosseum |
h) New Delhi |
i) Vadodara |
j) Chennai |
k) Red Fort |
l) Aegean |
m) Caspian |
n) Taj Mahal |
o) Jama Masjid |
p) Orange |
Possible answers:
- 1st – Pyramid, Colosseum, Taj, Great wall
- 2nd – Black, red, Caspian, Aegean
- 3rd – Chennai, Mumbai, Kochin, Vadodra
——————————————
TCS Digital Advanced Coding Questions
TCS Digital coding section consists of 1 question to be solved in 60 minutes. This means the difficulty level of the question is likely to be high and will involve knowledge of advanced coding concepts. Previous year TCS Digital questions from this section are given below.
1) Hop Game:
Dr. Felix Kline, the Math teacher at Gauss School introduces the following game to teach his students problem-solving. He places a series of “hopping stones” (pieces of paper) in a line with points (a positive number) marked on each of the stones.
Students start from one end and hop to the other end. One can step on a stone and add the number on the stone to their cumulative score or jump over a stone and land on the next stone. In this case, they get twice the points marked on the stone they land but do not get the points marked on the stone they jumped over.
At most once in the journey, the student is allowed (if they choose) to do a “double jump” – that is, they jump over two consecutive stones where they would get three times the points of the stone they land on but not the points of the stone they jump over
The teacher expected his students to do some thinking and come up with a plan to get the maximum score possible. Given the numbers on the sequence of stones, write a program to determine the maximum score possible.
Answer:
#include
int MAX(int a, int b, int c)
{
if(a>b && a>c)
{
return a;
}
else if(b>c)
{
return b;
}
else
{
return c;
}
}
int max_score(int stone_val[], int n,
int curr_stone_index,
int multi_factor,
int is_double_step_taken)
{
if(curr_stone_index>= n)
{
return 0;
}
int score = 0;
if(curr_stone_index != -1)
{
score = multi_factor * stone_val[curr_stone_index];
}
// No Skipping
// Moving to next stone
int val1 = max_score(stone_val, n,
curr_stone_index + 1,
1, // multipli. factor
is_double_step_taken);
// Skipping once
// multi factor = 2
int val2 = max_score(stone_val, n,
curr_stone_index + 2,
2, // multipli. factor
is_double_step_taken);
int val3 = 0;
if(is_double_step_taken == 0)
{
val3 = max_score(stone_val, n,
curr_stone_index + 3,
3, // multipli. factor
1 /* set double step taken */);
}
int max_score_among_3_options = MAX(val1, val2, val3);
int total_Score = score + max_score_among_3_options;
return total_Score;
}
int main()
{
// int n = 3;
// int stone_val[] = {4,2,3};
int n = 6;
int stone_val[] = {4,5,6,7,4,5};
printf("%d", max_score(stone_val, n,
-1, // Current step
1, // Multi factor
0 /* Double step taken */));
return 0;
}
2) Problem Statement: Card Shuffle
You have 100 cards, numbered 1 to 100. You distribute them into k piles and collect back the piles in order. For example, if you distribute them into 4 piles, then the first pile will contain the cards numbered 1, 5, 9, … and the 4 th pile will contain the cards numbered 4, 8, 12, …. While collecting back the cards you collect first the last pile, flip it bottom to top, then take the third pile, flip it bottom to top and put the cards on top of the 4th pile and so on. Next round, you distribute the cards into another set of piles and collect in the same manner (last pile first and first pile last).
- If we have 10 cards, and put them into 2 piles, the order of the cards in the piles (top to bottom) would be 9, 7, 5, 3, 1 and 10, 8, 6, 4, 2
- We flip the piles to get the order 1, 3, 5, 7, 9 and 2, 4, 6, 8, 10
- We put the second pile at the bottom and first on top of it to get the deck 1, 3, 5, 7, 9, 2, 4, 6, 8, 10
- Given the number of rounds (m), the number of piles in each round (ki), you need to write a program to find the Nth card from the top at the end of the final round.
Input:
- The input consists of a single line of (m+2) comma-separated integers.
- The first number is m, the number of rounds. The next m numbers are ki which represent the number of piles in each round.
- The last number in the input is N, the position in the final pile whose value is to be determined.
Output: One integer representing the Nth card after all rounds have been played.
Constraints: Number of rounds <= 10, number of piles in each round <= 13.
Example 1
Input: 2, 2, 2, 4
Output: 13
Explanation:
- m = 2, k1 = 2, k2 = 2 and N = 4.
- We have two rounds. The first round has two piles. At the end of the round, the deck is in the following order: 1, 3, 5, …, 99, 2, 4, 6, …, 100
- The next round also has 2 piles and after the second round, the cards are in the order 1, 5, 9, 13, ….
- The fourth card from the top has number 13.
Example 2
Input: 3, 2, 2, 3, 2
Output: 13
Explanation:
- m = 3, k1 = 2, k2 = 2, k3 = 3 and N = 2.
- After the second round, the cards are in the order 1, 5, 9, 13, …
- The third round has 3 piles. Thus after this round the cards will be in the order 1, 13, …. the Second card is 13.
Solution:
#include
int main()
{
int m;
scanf("%d", &m);
int pile[m];
for(int i = 0; i< m; i++)
{
scanf("%d", &pile[i]);
}
int N;
scanf("%d", &N);
int numbers[100];
int num = 1;
for(int i = 0; i < 100; i++)
{
numbers[i] = num++;
}
int arr[100][100];
int count = 0;
while(count < m)
{
int r = pile[count];
int c = 100 / pile[count];
if(pile[count] % 2 != 0)
{
c = c + 1;
}
int num = 0;
int x = 0;
int flag = 0;
for(int i = 0; i < r; i++)
{
num = x;
for(int j = 0; j < c; j++)
{
if(j == 0)
{
arr[i][j] = numbers[num];
num = num + pile[count];
}
else
{
int val = numbers[num];
num = num + pile[count];
if(val > 100)
{
break;
}
else
{
arr[i][j] = val;
}
}
}
x++;
}
int index = 0;
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c; j++)
{
if(arr[i][j] != 0)
{
numbers[index++] = arr[i][j];
}
}
}
count++;
}
printf("%d", numbers[N - 1]);
}
—————————————-
TCS Digital Programming Logic Questions
TCS Digital Programming logic section consists of 7 questions to be answered in 20 minutes. TCS Digital questions of this section will be asked from the following set of topics.
- C & Advanced concepts of C
- Data Structures & Algorithms
1) Consider the following doubly linked list: head-1-2-3-4-5-tail. What will be the list after performing the below-given sequence of operations?
Node temp = new Node(6,head,head,getNext());
head . setNext(temp);
temp . getNext() . setPrev(temp);
Node temp1= tail.getPrev();
tail.setPrev(temp1.getPrev());
temp1.getPrev().setNext(tail);
a) head-6-1-2-3-4-tail
b) head-6-1-2-3-4-5-tail
c) head-1-2-3-4-5-6-tail
d) head-1-2-3-4-5-tail
Answer: a
2) Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?
a) Dynamic programming
b) Backtracking
c) Greedy
d) Divide & Conquer
Answer: Option a
3) Eesha wrote the below program. Comment about the correctness of the program.
#include
int main ()
{
printf("%f\n", sum(10.1, 5.2));
return 0;
}
sum(a, b)
{
return (a+b);
}
a) Problem with return type and parameter types in function definition
b) conio.h not included
c) Command line parameters for main() not declared
d) There are no bugs in this program
Answer: Option a
Explanation: Default return type is int, but we need float as a return type
4) What is the time complexity of following function fun()? Assume that log(x) returns log value in base 2.
void fun()
{
int i, j;
for (i=1; i<=n; i++)
for (j=1; j<=log(i); j++)
printf("hello");
} }
a) Θ(nLogn)
b) Θ(n)
c) Θ(n^2)
d) Θ(n^2(Logn))
Answer: Option a
Explanation:
Time Complexity of the above function can be written as Θ(log 1) + Θ(log 2) + Θ(log 3) +
. . . . + Θ(log n) which is Θ (log n!)
Order of growth of ‘log n!’ and ‘n log n’ is the same for large values of n, i.e., Θ (log n!) = Θ(n log n). So
time complexity of fun() is Θ(n log n).
5) Consider the below code for insertion sort. The initial value of the array elements is given in the program as part of array initialisation. What will be the value of the array elements at the beginning of 6th iteration .
#include
#define N 10
int main()
{
int c, d, t;
int arr[N]={60,10,90,15,50,80,40,100,4,2};
for (c = 1 ; c <= N - 1; c++)
{
d = c;
while ( d > 0 && arr[d-1] > arr[d])
{
t = arr[d]; arr[d] = arr[d-1];
arr[d-1] = t;
d--;
} }
return 0;
}
a) 10 15 50 60 80 90 40 100 4 2
b) 10 15 50 60 90 80 40 100 4 2
c) 10 15 40 50 60 80 90 100 4 2
d) 10 15 60 90 50 80 40 100 4 2
Answer: Option a
Explanation:
Iteration 1 : 10 60 90 15 50 80 40 100 4 2
Iteration 2 : 10 60 90 15 50 80 40 100 4 2
Iteration 3 : 10 15 60 90 50 80 40 100 4 2
Iteration 4 : 10 15 50 60 90 80 40 100 4 2
Iteration 5 : 10 15 50 60 80 90 40 100 4 2 (end of 5th iteration is the beginning of the 6th).
6) A binary search tree is generated by inserting in order the following integers: 50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24. The number of nodes in the left subtree is ___________
Answer: 7
Explanation: