TCS Technical Sections Questions with Solutions

TCS Computer Science Questions, TCS Technical Papers, TCS Technical Questions with Answers, TCS CSE Questions, TCS Programming Language Efficiency Questions, TCS C Programming MCQ questions, C MCQ for TCS C MCQ questions, TCS MCQ C questions, TCS Technical MCQ Questions.

Get all the questions asked Today in TCS here – 

TCS Ninja Live Questions Dashboard

TCS Computer Science and Programming Papers with Answers

Online Classes

  1. Free Paid Materials also given
  2. Click here to join Online Live Class

TCS Paid Material –

No Online Class in this, in Online class you will get paid materials access also, but if you just want materials then you can buy the ones below –

or 

  1. Click here to join Online Live Class

Prices increase for Paid materials in

Minutes
Seconds

 

TCS Programming Language Efficiency Questions

TCS CSE Questions with Answers and Syllabus TCS Technical MCQ Questions

TCS Computer Science Papers – C Language Part 2

TCS Technical Questions with Solutions
  1. Eesha was in a wonderland where she saw a treasure trove of seven items of various items (in lakhs) and weights (in kgs) as per the table given below.

Value – Weight

12                4

10              6

8               5

11             7

14            3

5             10

5               12

She wanted to bring back maximum value of items but she was not able to carry more than 10 kgs.  Using dynamic programing, what is the maximum value of of the items that she could carry back with her.

Answer: 26

2. In c language, if a function return type is not explicitly defined then it defaults to what data type?

Answer: Int

3. Which of the following syntax is correct for command -line arguments?

a. int main (char *argv[], int argc)

b. none of the three options

c. int main ()

{

int argv, char *argc[];

}

d. int main(int var, char *varg[])

Answer: int main (int var,char *varg[])

TCS Computer Science Sections based Syllabus and Written Paper Pattern

Number Of Questions – 10 Questions

Time – 10 mins

TCS Technical MCQ Questions with AnswersNo. of TCS Technical QuestionsDifficulty of TCS MCQ C QuestionsImportance in TCS MCQ Technical Questions
Input Output3 – 4MediumHigh
Command Line Basics1 – 2MediumMedium
DSA3 – 4HighMedium
OOPS basic Concepts2MediumMedium

TCS Technical Questions based FACTS and FAQ’s

Ques. What is the level of difficulty for TCS Programming Language Efficiency Questions in test?

Ans. The level of difficulty lies between medium and hard for TCS Programming Language Efficiency Questions thus you must prepare well for tcs technical mcq questions.

How to solve TCS C Programming MCQ Questions

C MCQ for TCS

 TCS C MCQ Questions can be solved by preparing from our TCS C MCQ Questions Dashboard and you should also study from basic C and Data structure theory from a good book for tcs c programming mcq questions.

Question

Eesha was in a wonderland where she saw a treasure trove of seven items of various items (in lakhs) and weights (in kgs) as per the table given below.

itemsvaluesweights
1124
2106
385
4117
5143
6510
7512

She wanted to bring back maximum value of items but she was not able to carry more than 10 kgs.  Using dynamic programing, what is the maximum value of of the items that she could carry back with her.

Answer: 26

Question 2

In c language, if a function return type is not explicitly defined then it defaults to what data type?

Answer: Int

Question 3

Which of the following syntax is correct for command -line arguments?

a. int main (char *argv[], int argc)

b. none of the three options

c. int main ()

{

int argv, char *argc[];

}

d. int main(int var, char *varg[])

Answer: int main (int var,char *varg[])

Question 4

Advanced The figure depicts a search space in which the nodes are labelled with names like A,B,A1,B1. Node S is the start node. The goal are drawn as square boxes and the other noted in circle Enter answer as a sequence of node separated by a comma, please DO NOT enter any blanks anywhare in the response

For example, If the answer (order of nodes) is a followed by c, followed by A1, followed by D, the answer should be A,C,A1,D

Starting with the node start  node,list the order in which the depth first search algorithm explore the graph till termination, searching from right to left until it reaches one of the goal nodes.

Answer: S,C,J,T,I1

Question 5

The full set of operations allowed on a stack are

a. Push ,pop

b. Push,pop,remove

c. Push,pop, add,remove

d. Push,pop,add,remove,substitute

Answer: push,pop

Question 6

Realloc () function is used to:

a. Get back the memory that was released earlier using dree() funcion

b. Reallocate a file pointer when switching between files

c. Change the size of an array

d. Change the size of dynamically allocated memory

Answer: change the size of dynamically allocated memory

Question 7

Advanced Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed 0.5.

a. 10

b. 7

c. 6

d. 5

Answer: 10

Question 8

Question 8

 

Which of the below is NOT a data type in C language:

  1. Signed int
  2. Big int
  3. Short int
  4. Long int

Answer: Big int

Question 9

Eesha wants to implement an image viewer application to view images in a given folder. The application will be able to display an image and will also know what its next and previous images are at any given point of time so that the user can so that the user can view next/previous image by pressing right/left keys on the keyboard. Which data structure is appropriate for Esha to use?

  1. Tree
  2. Queue
  3. Linked list
  4. Stack

Answer: Linked list

Question 10

The pseudo code below sorts an array using bubble sort. Here A is the array and the” n” is the number of element in it. Function swap exchanges the value of 2 given value.

  1. Function bubbleSort(A,B)
  2. {
  3. For i =0 to n-2  step 1
  4. For j = 0 to n-1-2 step 1
  5. if( A (j) > A(j+1))
  6. Swap(A(j),A(j+1))
  7. }

TCS Ninja 4

This function is called with A and 7 as parameter where the array a initially contains the element 64, 34,  25,12, 22, 11, 9

  1. 34 25 12 22 11 9 64
  2. 25 12 22 11 9 34 64
  3. 11 9 12 22 25 34 64
  4. 12 11 9 22 25 34 64

Answer:25 12 22 11 9 34 64

Question 11

Advanced Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed 0.5.

  1. 10
  2. 7
  3. 6
  4. 5

Answer: 10

Question 12

#define is used to

a. Define a variable

b. Define a macro

c. Define a function

d. Define a constant

Answer: Define a macro it is

Question 13

What type of data structures are queues?

a. First in last out

b. First in first out

c. Last in first out

d. Last in last out

Answer: First in first out

Question 14

Which of the following is NOT a valid storage class in C language?

a. Extern

b. Dynamic

c. Register

d. Auto

Answer: Dynamic

Question 15

Eesha is developing a word processing software in which she wants to provide undo feature.the software will maintain all the sequential changes and at any point of time pressing control z will undo the latest  change,what data structure should Eesha use for this?

a. Stack

b. Queue

c. Linked list

d. Array

Answer: Stack

Question 16

#include<stdio.h>

Main(int argc,char**argv)

{

printf(“%s\n”,argv[–argc]);

Return 1;

}

The above program was run with the following command line parameters

Asha usha nisha easha

What was the output?

a. Nisha

b. Unable to run due to compilation error

c. No output,run time error

d. Eesha

Answer: Eesha

Question 17

Considering a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions? (NOTE:100 ^ 3 means 100 raised to the power 3)

a. (97 * 96 * 95) / 100 ^ 3

b. (97 * 96 * 95) / (6 * 100 ^ 3)

c. (97 * 97 * 97 ) / 100 ^ 3

d. (99 * 98 * 97) / 100 ^3

Answer: (97 * 97 * 97 ) / 100 ^ 3

Question 18

Advanced Consider the following graph starting at node A. In what order will the nodes be visited using a breadth first search?

TCS ninja 7

NOTE 1 : Is there is ever a decision between multiple neighbour nodes in the algorithm, assume we always choose the letter closest to the beginning of the first alphabet

NOTE 2: Enter the answer as a sequence of nodes separated by a comma. Please do NOT enter any blanks anywhere in the response. For example, is the answer (order of  nodes) is A followed by C, followed by X, followed by D. the answer should be A,C,X,D.

Answer: A,B,D,E,G,C,H,F

Question 19

This function is called with A and 7 as parameters where the array A initially contains the elements 34,14,65 be the value of the elements in A after 3 iterations of the outer loop?

TCS Ninja 9

a. 14 12 22 5 34 65 71

b. 14 34 22 12 65 5 71

c. 14 22 12  34 5 65 71

Answer: 14 12 22 5 34 65 71

Question 20

Eesha is developing an IP telephony software in which the audio is encoded and transmitted by the sender as network packets through a communication channel. At the other end these packets are assembled and processed further.eesha recognizes that there maybe a very large number of packets this number is unknown nd which will be processed while more packets are being received .assume that the packets arrive in right order .what data structure should eesha use?

    • Array
    • List
    • Queue
    • Stack Answer: List

Question 21

A structure in C language is

    • System defined data type that holds predefined collection of data types
    • User defined data type holding similar or dissimilar data types
    • Another name for union data type
    • A collection of similar user defined data type

Ans : User defined data type holding similar or dissimilar data types

Question 22

Which of the following is true for binary tree ?
A) a node can have a single child also
B) it must have two child only 
C) other options I don’t remember r

Question 23

For(i=7;i!=0;i–)
Print(“%d”,i);
Ch=get char();
What will be the output?

  • Compilation error
  • infinite loop
  • Number display from 7 to 1 in descending order.
  • Number display from 7 to 0 in descending order

Question 24

The expression seems to be infix is solved using the data structure

  • stack
  • queue
  • linked list
  • tree

Answer – Stack

Question 25

To get the most accurate value we prefer the data type

  • int
  • long int
  • float
  • double

Answer – Double

Question 26

main(int argc,char*argv[])

in the above Definition of main function the variable argv denotes:

    • An array of character pointers the first array item pointing to the program name and remaining pointing to the command line parameters
    • An array of character pointer each pointing to the command line parameters
    • A pointer to character that points to command line parameters
    • A pointer to pointer that points to the memory location where the program has been loaded to the memory

Ans: An array of character pointers the first array item pointing to the program name and remaining

Question 27

#include <stdio.h> Int main()

{

Int n,ch, for(n=7;n!=0;n–)

printf(“n=%d”,n–) ch=getchar(); Return 0;

}

Infinite loop

Numbers 7 to 0 in descending order

None of the other choices as there is a compilation error Numbers 7 to 1 in descending order.

Ans: Infinite loop

Question 28

Eesha works for ISRO where she is involved in a mission to intercept a comet that is likely to collide with in each with in 1 month.she is developing a c program to calculate the trajectory of the missile to be launched to intercept and destroying the approaching comet.in order to achieve highest accuracy of the missile trajectory what data type should she use for the variables in her equation??

  • Long int
  • Double
  • Float
  • Int Ans: Double

Question 29

a program reads in 500 integers in the range [0…100]representing the scores of 500 students.it then prints the frequency of each score above 50.what would be the best way for the program to store the frequencies?

  • An array of 101 numbers
  • An array of 50 numbers
  • An array of 500 numbers
  • A dynamically allocated array of 550 numbers Ans: An array of 50 numbers

Question 30

Which of the following is TRUE about binary trees?

The number of nodes on the last level is equal to the sum of the number of nodes on all other levels

A.A node may have one child

  • The total number of nodes is one less than a power of 2
  • Every node must have 2 children Ans : A node may have one child

Question 31

#include <studio . h> Long int fact (int n);

Int main ()

{

Int n;

Printf (“enter a positive integer: “); Scanf (“%d”, &n);

printf(“factorial of %d = %ld “, n, fact (n)); Return 0;

}

Long int fact (int n)

{

If (n.=1)

Return n*fact (n-1)

Else

}

Return 1;

Ans: recursion

Question 32

Not a core of os

a)multi tasking

b) memory management

C) virus protection

d) file management

Answer – C

Question 33

Which are crt options for array

A) same type

B) sequential memory allocation

c) we can change size of array at run time

D) counting items appropriate

Answer !

Question 34

Which of the following statements are true..?
1. DFS linearly grows with depth.
2. BFS always has the shortest path from start state to goal state.
3. DFS uses stack
4.BFS uses queue.

Question 35

Esha writes a prgm for factorial but she forgot to write the function fact what is the error displayed
A)file not found
B)syntax errors
c)it takes the function from standard library

Question 36

Eesha wants to incorporate a history feature .When she presses “go back” then it will be able to be vist the previous page.what data type is used ?
1. Tree
2. Queue
3. Stack
4. Array.

Extra Questions without Solutions and Options that students couldn’t remember, please add solutions in the comment section below you will find below –

  1. What should one use if want to create a image viewer application if u want to view the image as well as prev and next image? Opt- stack que linkedlist .
  2. Function of realloc()
  3. If not declaring any return type explicitly in c, what is the default return type?
  4. Full functionality of stack? Opt- push pop , push pop add, push pop add remove, push pop add remove substitute
  5. In a hash table all keys r uniformly distributed. Hash table size 20. After how many iteration does d key collide exactly after time interval of +0.5.
  6. Working concept of bubble sort
  7. Correct syntax for command line argument
  8. Which of dese data type is not valid in C ? Option – long int, big int, short int
  9. 1. What is the principle for stack data structure.?
    Last – In-First – Out
  10. They’ve given a bubble sort program and asked us to find the error in which line.. Sir
  11. 1.stack follows:LIFO,filo,fifo,lilo
  12. 2.meaning of structure in c A)user defined of similar data types
    B)same as union
    C)user defined of similar and disimmilar data types
    D)system defined of different data elemnets
  13. 3.spotting error in given program sum of elements in given matrix
  14. 4.bubble sort program find the output after 3 iterations
  15. Which of the following is not string function strlen strcpy strstr strchar
Summary
Review Date
Reviewed Item
TCS Programming Language Efficiency
Author Rating
51star1star1star1star1star