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

TCS Placement Questions & Answers :: TCS

390.87K

Tot. Mock Test: 40


Total Qs: 652+

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

621 / 652

What is the output of this C code?
#include <stdio.h> 
typedef struct p *q; 
struct p
{
int x; char y; q ptr;
};
int main()
{
struct p p = {1, 2, &p};
printf("%d\n", p.ptr->ptr->x); 
return 0;
}

ACompile time error

BSegmentation fault

CUndefined behavior

D1

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

622 / 652

Is the below declaration valid?
int* ((*x)())[2];

ATrue

BFALSE

CUndefined behavior

DDepends on the standard

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

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

623 / 652

Choose the correct option.
Which function will not be called in the following program?

#include <stdio.h>
void first()
{
printf("first");
}
void second()
{
first();
}
void third()
{
second();
}
void main()
{
void (*ptr)();
ptr = third;
ptr();
}

AFunction first

BFunction second

CFunction third

DNone of these

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

624 / 652

Choose the correct option.

The syntax for constant pointer to address (i.e., fixed pointer address) is:


Aconst *

B * const

C const *

DBoth (A) and (C)

Answer: Option B

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

625 / 652

Choose the correct option.

Preprocessor feature that supply line numbers and filenames to compiler is called?


ASelective inclusion

Bmacro substitution

CConcatenation

DLine control

Answer: Option D

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS

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

626 / 652

What is the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0; 
while (i = 0)
printf("True\n");
printf("False\n");
}

ATrue (1 time) False

BTrue (infinite time)

CFALSE

DCompiler Dependent

Answer: Option C

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

627 / 652

What is the output of the following C code?
#include <stdio.h>
int main()
{
int i = 0;
for (foo(); i == 1; i = 2)
printf("In for loop\n");
printf("After loop\n");
}
int foo()
 {
 return 1;
 }

AAfter loop

BIn for loop after loop

CCompile time error

DInfinite loop

Answer: Option A

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

628 / 652

Choose the correct option.

Which of the following typecasting is accepted by C?


AWidening conversions

BNarrowing conversions

CBoth

DNone of the mentioned

Answer: Option C

Explanation:

Here is no explanation for this answer

Submit Your Solution

Tags: TCS TCS NQT

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

629 / 652

Choose the correct option.

\(\frac{2}{3}\)rd of the balls in a bag are blue, the rest are pink. if \(\frac{5}{9}\)th of the blue balls and \(\frac{7}{8}\)th of the pink balls are defective, find the total number of balls in the bag given that the number of non-defective balls is 146?


A216

B649

C438

D578

Answer: Option C

Explanation:

Let total no of balls = x blue = \(\frac{2x}{3}\)
pink = \(\frac{x}{3}\)
Total no of defective balls = \(\frac{10x}{27} + \frac{7x}{24}\)
= \(\frac{143x}{216}\)
Non defective balls = \(x - \frac{143x}{216} = 146\)
=> x = 432

Submit Your Solution

Tags: TCS TCS NQT

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

630 / 652

Choose the correct option.

Find the no. of ways in which 4 particular persons a,b,c,d and 6 more persons can stand in a queue so that A always stand before B. B always stand before C, And C always stand before D.


A6!

B7!

C1006*6!

D10046!

Answer: Option B

Explanation:

a,b,c,d are grouped ie consider them as one and remaining as 6.
Total 6+1 = 7! Ways

Submit Your Solution

Tags: TCS


Here is the list of questions asked in TCS Aptitude Test Question with Answers page 63. Practice TCS Written Test Papers with Solutions and take Q4Interview TCS Online Test Questions to crack TCS written round test. Overall the level of the TCS Online Assessment Test is moderate. Only those candidates who clear the written exam will qualify for the next round, so practic all the questions here and take all the free tests before going for final selection process of TCS