Skip to main content

TCS placement paper 16

CS

Question 1: There is a toy train that can make 10 musical sounds. It makes 2 musical sounds after being defective. What is the probability that same musical sound would be produced 5 times consecutively? ( 1 of )
Answer: 1/2 * 1/2 * 1/2 * 1/2 * 1/2 = 1/32
32 will be the answer. (My friends got similar question with "3 times consecutively"; for that the answer would be 8)

Question 2: Peter and Paul are two friends. The sum of their ages is 35 years. Peter is twice as old as Paul was when Peter was as old as Paul is now. What is the present age of Peter?
Luckily, I had this question twice. Initially I left it because of the confusing statement but when I got the same question second time with different names of the friends (Pooja and Prasad) then I gave a little extra time and solved it.
Answer: 20 years. I simply substituted the answers in the statement to find the best fit, because the statement in the question was pretty confusing.

Question 3: The ages of two friends is in the ratio 5:6. After how many years will the ages be in the ratio 7:8?
Answer: 10 years.

Question 4: (There was a long story, I'll cut short it). There are 5 materials to make a perfume: Lilac, Balsalmic, Lemon, Woody and Mimosaic. To make a perfume that is in demand the following conditions are to be followed: Lilac and Balsalmic go together. Woody and Mimosaic go together, Woody and Balsalmic never go together. Lemon can be added with any material. (Actually they had also mentioned how much amount of one can be added with how much quantity of the other; but that's not needed for the question.) All of the following combinations are possible to make a perfume EXCEPT:
1) Balsalmic and Lilac
2) Woody and Lemon
3) Mimosaic and Woody
4) Mimosaic and Lilac
Answer: Mimosaic and Lilac. I have made the question here really easy to understand. But the actual question was in a twisted language and it was difficult to find the answer. It took me some time to get to the answer.

Question 5: A girl has to make pizza with different toppings. There are 8 different toppings. In how many ways can she make pizzas with 2 different toppings.
Answer: 8 * 7 = 56

Question 6: A triangle is made from a rope. The sides of the triangle are A cm, B cm and C cm. (I do not remember the numerical value). What will be the area of the square made from the same rope?

Question 7: What is the distance of the z-intercept from the x-intercept in the equation ax+by+cz+d=0. (I do not remember the values of a,b,c,d)

Question 8: An athlete decides to run the same distance in 1/4th less time that she usually took. By how much percent will she have to increase her average speed?
Answer: 33.33%

Question 9: A horse chases a pony 3 hours after the pony runs. Horse takes 4 hours to reach the pony. If the average speed of the horse is 35 kmph, what s the average speed of the pony? (This question was really long with loads of irrelevant statement)

These are a few questions that I could recall. I made through the aptitude round by attempting 16 questions. Next was Technical Interview Round.

Technical Interview:
Here I will discuss the technical questions that were asked to me and also the questions asked to my friends.

Question 1: Write the pointer representation of a[i][j][k].

Question 2: i = 5
i++, ++i, --i, i--, 5
What will be the output if it is printed?

Question 3: How will you insert a new node between any two nodes in a linked list? Write the code.

Question 4: How will you find a particular data in the linked list?

Question 5: What is MD5?

Question 6: What is RSA? Explain its principle.

Question 7: There is a triangle and 3 ants on each vertex of the triangle. The 3 ants start to move randomly along the edges of the triangle. What is the probability that two ants will collide?

Question 8: What is the difference between C and C++?

Question 9: What do you mean by polymorphism?

Question 10: Give an example of polymorphism with code.

Question 11: What do you mean by OOP?

Question 12: What is inheritance?

Question 13: What is a friend function?

Question 14: What is an abstract class?

Question 15: Suppose there is a number 235 such that sum of first two digits is equal to the third digit. How many such 3 digits number are possible?

Question 16: Why is the VIRTUAL keyword used in C++?

Question 17: Which keyword is written to use a variable declared in one class in the other class?

Question 18: Suppose a code is written in C and you want to use that code in C++. How can you do that?

Question 19 What do you mean by DML?

Question 20: Is there any language other than SQL where DML is used? If yes, then which?

Question 21: How many normal forms do we have?

Question 22: Here is a tic-tac-toe game which is being played by 2 people:
x o _
o _ _
x o x

Represent the blank spaces. Who played the last chance (x or o)?

Technical Questions asked to my friends:

Question 1: What is a transaction? Properties of Transaction?

Question 2: What "condition" will be written in the if statement such that both Hello World are printed when the following code is executed.

if(condition)
{
printf("Hello");
}
else
{
printf("World");
}

Question 3: What will be the output of the following code?
int i=5;
printf("%d, %d, %d", i++, i, ++i);

Which C compiler do you use? (My friend said TURBO)
What will be the output of above code in TURBO compiler? (He said same)
No! It will not be the same.

Comments

Popular posts from this blog

Amazon Tree traversal Questions | Amazon interview Questions

The following function is supposed to calculate the maximum depth or height of a Binary tree -- the number of nodes along the longest path from the root node down to the farthest leaf node. int maxDepth( struct node* node) {     if (node==NULL)         return 0;     else     {         /* compute the depth of each subtree */         int lDepth = maxDepth(node->left);         int rDepth = maxDepth(node->right);             /* use the larger one */         if (lDepth > rDepth)             return X;         else return Y;     } } What should be the values of X and ...

TCS placement paper 13

1) Two pipes A and B fill at A certain rate B is filled at 10,20,40,80,. If 1/16 of B if filled in 17 hours what time it will take to get completely filled Ans 21 2) In a shopping mall with a staff of 5 members the average age is 45 years. After 5 years a person joined them and the average age is again 45 years. What’s the age of 6th person? 3) Find (4x+2y)/ (4x-2y) if x/2y=2 4) Find average speed if a man travels at speed of 24kmph up and 36kmph down at an altitude of 200m. Formula is 2xy/(x+y) 5) Same model as 4th question. But it is on flat surface. Formula is same 2xy/(x+y). 6) Six friends go to pizza corner there are 2 types of pizzas. And six different flavors are there they have to select 2 flavors from 6 flavors. In how many ways we can select? Ans: 6C2 7) 3, 15, x, 51, 53,159,161. Find X Ans: 17 8) 3 friends A, B, C went for week end party to McDonald’s restaurant and there they measure there weights in some order IN 7 rounds. A;B;C;A...

Amazon’s most asked interview questions

k largest(or smallest) elements in an array | added Min Heap method Question:  Write an efficient program for printing k largest elements in an array. Elements in array can be in any order. For example, if given array is [1, 23, 12, 9, 30, 2, 50] and you are asked for the largest 3 elements i.e., k = 3 then your program should print 50, 30 and 23. Recommended: Please solve it on “ PRACTICE  ” first, before moving on to the solution. Method 1 (Use Bubble k times) Thanks to Shailendra for suggesting this approach. 1) Modify Bubble Sort to run the outer loop at most k times. 2) Print the last k elements of the array obtained in step 1. Time Complexity: O(nk) Like Bubble sort, other sorting algorithms like Selection Sort can also be modified to get the k largest elements. Method 2 (Use temporary array) K largest elements from arr[0..n-1] 1) Store the first k elements in a temporary array temp[0..k-1]. 2) Find the smallest element in temp[...