You are on page 1of 6

TNQT Digital Sample Questions

TCS Confidential Page | 1


English:
During the last years of 18th century, France was in bankruptcy. Louis XVI's splurge, costly involvement in American
Revolution, poor harvest owing to drought and cattle disease all contributed to this financial crisis. Hence, a financial
reform package was proposed by Louis' Controller General that would remove the tax holiday enjoyed by the privileged
class. An assembly representing France's clergy, nobility and middle class was scheduled on May 5,1789. However, the
non-privileged class, forming 98% of French population wanted the ruler to abolish the veto power hitherto enjoyed by the
noble class. By the time, the meeting was convened, there was already an uncontrollable hostility between the groups that
hijacked the original intent for which the assembly was scheduled. Later, Louis XVI grudgingly endorsed the
representations from the middle class and granted equal voting power to all.

1. Which one of the following is a reason for France's financial crisis?

 Cows and sheep could not get any fodder


 Inflation rate was very high
 Farmers were not available for harvest
 French ruler was very extravagant

2. What was the reason for the controller general to convene a meeting?

 To propose and pass the resolution to reduce the tax rates across the entire
country
 To propose and pass a resolution towards curbing public and royal expenditure
 To propose and pass a resolution for giving more doles to the poor
 To propose and pass the resolution that all the members of the noble class
 should also pay tax

3. Did the proposed meeting discuss the primary agenda?

 No, there were not many members who attended the meeting
 No, the king changed the agenda of the meeting
 Yes, the meeting went as scheduled and the points in the original agenda were
discussed
 No, the majority wanted to undo the elite class' veto power

4. The king after the proposed meeting:

 Agreed to the demands of the majority reluctantly


 Refused to accept any of the demands from the middle-class
 Willingly conceded to the representations from the middle class
 Fully supported the stance taken by the noble class

5. What is the MOST appropriate title for this passage?

 How to handle a national crisis


 King Louis' uncanny moves
 Rise of French democracy
 French revolution

TCS Confidential Page | 2


Advanced Quantitative Aptitude:

1. Each student in a class of 40 plays at least one indoor game chess, carrom and scrabble. 18 play chess, 20 play
scrabble and 27 play carrom. 7 play chess and scrabble, 12 play scrabble and carrom and 4 play chess, carrom and
scrabble. Find the number of students who play chess and carrom.

2. In this problem A^B means A raised to the power B. What is the tenth digit to the right of the decimal point, in the
decimal expansion of (1/5)^10

3. There are 5 violinists, 8 guitarists, and 7 drummers in a music club. A group of 6 students will be chosen to
compete in a competition. How many combinations of students are possible if the group is to consist of an equal
number of violinists, guitarists, and drummers?

4. In a mathematical competition consisting of 12 problems, 8 marks are given for each correct response, 0 marks for
each incorrect response and each no response is awarded 3 marks. Eesha scored 35 marks in this competition. The
largest number of incorrect responses she could have had is ?

5. The average age of a family of 5 members is 20 years. If the age of the youngest member be 10 years then what was
the average age of the family at the time of the birth of the youngest member?

Option 1 : 12.5
Option 2 : 13.5
Option 3 : 14
Option 4 : 15

6. A dice has 6 faces. Four such dice are thrown simultaneously. Find the probability that all of them show the same face.

Option 1 : 1/216
Option 2 : 1/36
Option 3 : 4/216
Option 4 : 3/216

7. What is Eesha’s present age, if after 20 years her age will be 10 times her age 10 years back?

Option 1 : 13.3 Yrs


Option 2 : 6.2 Yrs
Option 3 : 7.7 Yrs
Option 4 : 10 Yrs

8. A five digit number is formed using digits 1, 2, 3, 6, 9 without repeating any one of them. What is the sum of all possible
numbers?

Option 1 : 5599944
Option 2 : 5599934
Option 3 : 5599444
Option 4 : 5699944

9. Two trains running in opposite directions cross a man standing on the platform in 27 seconds and 17 seconds
respectively and they cross each other in 23 seconds. The ratio of their speeds is:

Option 1 : 3:2
Option 2 : 1:3
Option 3 : 3:4

TCS Confidential Page | 3


Option 4 : 1:2

10. Given that (1/x) > -3, which of the following cannot be the value of x?

Option 1 : -1/3
Option 2 : -1/2
Option 3 : -3
Option 4 : -1

Advanced Programming Logic :

1. Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?

Option 1 : Dynamic programming


Option 2 : Backtracking
Option 3 : Greedy
Option 4 : Divide & Conquer

2. Eesha wrote the below program . Comment about the correctness of the program.

#include <stdio.h>
int main ()
{
printf("%f\n", sum(10.1, 5.2));
return 0;
}
sum(a, b)
{
return (a+b);
}
Option 1 : Problem with return type and parameter types in function definition
Option 2 : conio.h not included
Option 3 : Command line parameters for main() not declared
Option 4 : There are no bugs in this program

3. 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"); }
}
Option 1 : Θ(nLogn)
Option 2 : Θ(n)
Option 3 : Θ(n^2)
Option 4 : Θ(n^2(Logn))

TCS Confidential Page | 4


4. 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 <stdio.h>
#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;
}

Option 1 : 10 15 50 60 80 90 40 100 4 2
Option 2 : 10 15 50 60 90 80 40 100 4 2
Option 3 : 10 15 40 50 60 80 90 100 4 2
Option 4 : 10 15 60 90 50 80 40 100 4 2
5. 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 ___________

Advanced Coding:

Bridges
A simple (undirected) graph is a set of vertices and edges, where an edge is incident on precisely two distinct
nodes, and a pair of nodes have at most one edge between them. It is said to be connected if there is a path
among the edges between any pair of nodes. The picture on the left shows a graph with vertices
{1,2,3,4,5,6,7,8} and edges {a,b,c,d,e,f,g,h,i,j}. A tree is a simple connected graph in which any two vertices
are connected by exactly one path. The subset of edges {d,e,f,g,h,i,j) with the same vertex set is a tree (picture
in the middle). A cycle is a sequence of vertices starting and ending at the same vertex, two consecutive
vertices in the sequence are connected by an edge in the graph. The sets {a,d,e} {b,e,f} and {a,b,f,d} are cycles.
Every simple connected undirected graph has at least one subset of edges which, when taken together with its
vertices, form a tree. The subset {d,e,f,g,h,i,j) forms a tree (the set of edges {a,b,c} is not in this tree). If any
edge in the graph but not in the tree is added to the tree, cycle is created, called a fundamental cycle. If edge a
is added to the tree, the fundamental cycle {a,d,e} is formed (picture on the right). Similarly, {b,e,f} and
{c,h,i,j} are fundamental cycles formed by adding edges b and c respectively to the tree. It can be shown that
an edge in any cycle in a graph must be a member of one of the fundamental cycles of any tree.

TCS Confidential Page | 5


A bridge is an edge in a simple connected graph, if it is not part of any cycle. The edge g is the only bridge in
the graph on the left.
Set language
A special set language has been defined for this problem for you to use:
 If S and T are sets of edges,
o S + T is the union of the sets
o S & T is the intersection of the sets
o !S is the complement of the set S with respect to all the edges in the graph. In the pictures above,
if S = {a,c,f}, then !S is {b,d,e,g,h,i,j}
o S – T is the difference of the sets
 The set operations are executed in the left to right order. Brackets (parentheses) may be used to control
the order of this execution
 A function COUNT_OF(S) is available to count the number of elements of set S
 The language is case-sensitive
For example, if S = {a,b,c} , and T = {c,d,e,f}, then COUNT_OF (S+T) = 6, COUNT_OF (S&T) = 1,
COUNT_OF (S-T) = 2 [as S-T = {a,b}]
Problem
An underlying simple connected undirected graph is there, and a subset of edges have been taken to form a tree.
You have been given a function #cycle(x). Here x is an edge not in the tree. #cycle(x) returns the set of edges
in the fundamental cycle that is obtained by adding edge x to the tree. In the pictures above, #cycle(a) would be
{a,d,e}.
Using this function and the special set language, write an expression that gives the number of bridges in the
underlying graph. In the pictures above, g is the only bridge and hence the expected output is 1.
In this problem, in all the cases, the set of edges in the graph, but not in the tree will be {a,b,c}.

TCS Confidential Page | 6

You might also like