[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Placement Questions & Answers :: TCS Ninja

61. Shantanu wants to make a program to print the sum of the first 7 multiples of 6. He writes the following program:

integer i = 0 // statement 1
integer sum // statement 2 while ( i <= 42 ) // statement 3
{
sum = sum + i // statement 4 i = i + 6;
}
print sum // statement 6

Does this program have an error? If yes, which one statement will you modify to correct the program?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

62. A robust program has which one of the following features?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

63. Shahaana has a 10,000 line code. She is trying to debug it. She knows there is a logical error in the first 25 lines of the code. Which of the following will be an
efficient way of debugging:

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

64. What does this function compute for positive n? function f(int n)
{
if (n equals 1)
{ return 1 } else
{ return f(n-1)/f(n-1) + n }
}

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS Ninja 

65. What does a compiler do?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

66. A program is compiled by Tarun on his machine. Whether it will run on a different computer will depend upon:

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

67. Consider the following code:
for i= m to n increment 2
{ print "Hello!" }
Assuming m < n and exactly one of (m,n) is even, how many times will Hello be printed?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital 

68. 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.

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS Ninja 

69. The memory space needed by an algorithm has a fixed part independent of the problem instance solved and a variable part which changes according to the problem instance solved. In general, which of these two is of prime concern to an algorithm designer?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS Ninja 

70. 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?

Answer:

Explanation:

Here is no explanation for this answer

Workspace

Tags:

TCS NQT TCS Ninja TCS Digital