Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

# Practice Questions & Answers :: AMCAT

122.61K

## Total Practice Qs: 307+

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

301 / 307

Choose the correct option.

Ravi has to add an strictly upper triangular (no elements at diagonal) and a strictly lower triangular square matrix (no elements at diagonal) and put the result in a third matrix. What is the time complexity of Ravi's algorithm? Assume that storing a value in a memory space takes negligible time, while each addition between values takes the dominating amount of time.

A&theta(n^2)

B&theta(n)

C&theta(1)

DNone of these

ENone of these

| | Topic: | Asked In TCS NinjaAMCAT |

Explanation:

Here is no explanation for this answer

Tags: TCS Ninja

NA
SHSTTON
5
Solv. Corr.
3
Solv. In. Corr.
8
Attempted
0 M:0 S
Avg. Time

302 / 307

Choose the correct option.

Ravi is writing a program in C++. C++ uses the 'for' keyword for loops. Due to distraction, Ravi writes 'gor' instead of 'for'. What will this result to?

AThe code will not compile

BThe code will give an error while in execution

CThe code may work for some inputs and not for others.

DIt will create no problems.

ENone of these

| | Topic: | Asked In TCS NQTTCS NinjaTCS DigitalAMCAT |

Explanation:

Here is no explanation for this answer

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

303 / 307

Choose the correct option.

function g(int n)
{
if (n > 0) return 1;
else return -1;
}
function f(int a, int b)
{
if (a > b) return g(b-a); if (a < b) return g(-a+b); return 0;
}
If f(a,b) is called, what is returned?

AAlways +1

B-1 if a > b, 1 if a < b, 0 otherwise

C1 if a > b, -1 if a < b, 0 otherwise

D0 if a equals b, -1 otherwise

ENone of these

| | Topic: | Asked In CapgeminiAMCAT |

Explanation:

Here is no explanation for this answer

Tags: Capgemini

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

304 / 307

Choose the correct option.

Gautam is given two codes, A and B, to solve a problem, which have complexity &theta(n) and &theta(n2) respectively. His client wants to solve a problem of size k, which Gautam does not know. Which code will Gautam deliver to the client, so that the execution is faster?

ACode A

BCode B

CGautam cannot determine

DBoth codes have the same execution time, so deliver any.

ENone of these

| | Topic: | Asked In CapgeminiAMCAT |

Explanation:

Here is no explanation for this answer

Tags: Capgemini

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

305 / 307

Choose the correct option.

function g(int n)
{
if (n > 0) return 1;
else return -1;
}
function f(int a, int b)
{
if (a > b) return g(b-a);
if (a < b) return g(a-b); return 0;
}
If f(a,b) is called, what is returned?

AAlways -1

B1 if a > b, -1 if a < b, 0 otherwise

C0 if a equals b, -1 otherwise

D0 if a equals b, -1 otherwise

ENone of these

| | Topic: | Asked In CapgeminiAMCAT |

Explanation:

Here is no explanation for this answer

Tags: Capgemini

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

306 / 307

Choose the correct option.

How many comparisons are needed to sort an array of length 5 if a straight selection sort is used and array is already in the opposite order?

A1

B10

C50

D20

ENone of these

| | Topic: | Asked In TCS NinjaAMCAT |

Explanation:

Here is no explanation for this answer

Tags: TCS Ninja

NA
SHSTTON
1
Solv. Corr.
0
Solv. In. Corr.
1
Attempted
0 M:4 S
Avg. Time

307 / 307

Choose the correct option.

Rajni wants to create a data-type for the number of books in her book case.
Her shelf can accommodate a maximum of 75 books. She allocates 7 bits to the datatype.
Later another shelf is added to her book-case. She realizes that she can still use the same data-type for storing the number of books in her book-case. What is the maximum possible capacity of her new added shelf?

A52

B127

C53

D75

ENone of these

| | Topic: | Asked In CapgeminiAMCAT |