TCS programming multiple-choice questions (MCQs) are an essential part of the latest TCS recruitment drive. Practicing these MCQs will help candidates prepare effectively for the exam.
The TCS programming section consists of 10 MCQs, with a time duration of 20 minutes. This means candidates must answer each question in approximately 2 minutes.
TCS has officially released the types of questions expected in the programming MCQs section:
Question: Eesha found a treasure trove with 7 items of varying values (in lakhs) and weights (in kgs). She can only carry 10 kgs. Using dynamic programming, what is the maximum value she can carry?
Answer: 25 lakhs
Question: In C language, if a function’s return type is not explicitly defined, what data type does it default to?
Answer: int
Question: Which of the following is the correct syntax for command-line arguments?
a) int main (char *argv[], int argc)
b) None of the above
c) int main() { int argv, char *argc[]; }
d) int main(int var, char *varg[])
Answer: *d) int main(int var, char varg[])
Question: Which operations are allowed on a stack?
a) Push, pop
b) Push, pop, remove
c) Push, pop, add, remove
d) Push, pop, add, remove, substitute
Answer: a) Push, pop
Question: What is the purpose of the realloc()
function?
a) Retrieve previously released memory.
b) Reallocate a file pointer.
c) Change the size of an array.
d) Change the size of dynamically allocated memory.
Answer: d) Change the size of dynamically allocated memory.
Question: Which of the following is NOT a data type in C?
a) Signed int
b) Big int
c) Short int
d) Long int
Answer: b) Big int
Question: Eesha wants to develop an image viewer application that allows users to navigate forward and backward. Which data structure is best suited?
a) Tree
b) Queue
c) Linked List
d) Stack
Answer: c) Linked List
Given an array [64, 34, 25, 12, 22, 11, 9]
, what will be the array after one pass of Bubble Sort?
a) 34 25 12 22 11 9 64
b) 25 12 22 11 9 34 64
c) 11 9 12 22 25 34 64
d) 12 11 9 22 25 34 64
Answer: b) 25 12 22 11 9 34 64
Question: What is #define
used for in C?
a) Defining a variable
b) Defining a macro
c) Defining a function
d) Defining a constant
Answer: b) Defining a macro
Question: What type of data structure is a queue?
a) First-In-Last-Out
b) First-In-First-Out
c) Last-In-First-Out
d) Last-In-Last-Out
Answer: b) First-In-First-Out (FIFO)
Question: Which of the following is NOT a valid storage class in C?
a) Extern
b) Dynamic
c) Register
d) Auto
Answer: b) Dynamic
Question: Eesha is developing a text editor with an undo feature. Which data structure should she use?
a) Stack
b) Queue
c) Linked List
d) Array
Answer: a) Stack
Conclusion
Preparing for TCS programming questions is crucial for acing the recruitment process. The 2019 TCS Programming MCQs covered key topics like Data Structures, Algorithms, C, Java, and problem-solving skills, making it essential for candidates to practice thoroughly. By solving previous years’ questions and understanding the concepts behind them, aspirants can improve their coding proficiency and boost their chances of success in TCS placement exams.