TCS Digital Previous Year Question Papers PDF
TCS Digital Previous Year Question Papers PDF
TCS Digital Previous Year Question Papers PDF
a) state of war
b) hostility
c) biologic attack
d) War fought by two powers by using a supplement country in between.
Answer: d
——————————————
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.
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
b, e, m, g
o, f, n, j
a, c, d, p
a) Pyramids of
b) Kochi c) red d) black
Giza
e) great wall of
f) Mumbai g) Colosseum h) New Delhi
China
i) Vadodara j) Chennai k) Red Fort l) Aegean
m) Caspian n) Taj Mahal o) Jama Masjid p) Orange
Possible answers:
——————————————
#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
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:
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]);
}
—————————————-
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);
}
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).