TCS NQT - Programming Logic

page 1 out of 3

Question 1

Given here is a scenario. Consider the graph algorithm and answer the given question.

John wants to go to different locations of the city in which he is. He has listed all of them down. However, he wants to visit one location before visiting some other location What application of graphs he uses to determine that location?

Question 2

Which among the following is a server - based paradigm?

Question 3

There are two integer numbers X and Y that are between 0 to 25. User stores the value under a 5 bit number. How many minimum bits are required to store the result of the below expression?

Res=3*(X-Y)

Question 4

Find Prefix and suffix for the below infix problem statement :
Infix Expression : a +b/c*(d-e)^f^g

Question 5

When we declare constant pointer to integer, we CANNOT change:

Question 6

Construct post order Transversal for the constructed tree with the given In-Order and Preorder Traversals:

In-Order: 9 7 10 6 8
Pre-Order: 6 7 9 10 8

Question 7

float num1; short num2; long num3;

What is the data type of num1-num3/num2?

Question 8

The kind of software testing you can do when you have both the source code and the executable code in hand, is called as?

Question 9

Select the precise options for the below scenarios
Expression 1: cout<
Expression 2: cout<<”\n”<

Question 10

Spot the error in the given code. If there is no error, select the most appropriate option

```#include<iostream>
using namespace std;
class Employee{
private:
int UserId;
public:
Employee(): UserId(0) {}
frient int displayUser(Employee);

};
int displayUser(Employee emp){
emp.UserId +=12;
return emp.UserId;
}
int main(){
Employee e;
cout << "Employee UserId:"<<displayUser(e)<<endl;
return 0;
}```

page 1 out of 3

Oops!!

To view the solution need to Login

Score : 0 / 0
L
o
a
d
i
n
g
.
.
.