TCS Programming MCQs: 2026 NQT Pattern and 12 Worked Examples
Practice the TCS NQT programming section with 12 re-verified MCQs covering C language, data structures, and sorting algorithms. Updated for the 2026 exam pattern.
TCS NQT programming MCQs are 10 questions in 20 minutes, one of four sections that collectively determine which hiring track a candidate qualifies for.
What the TCS NQT Programming Section Tests
The programming section is distinct from the TCS NQT coding section that follows it. These are multiple-choice questions: you read code, trace output, spot bugs, or apply conceptual knowledge. You don’t write code from scratch here.
TCS officially lists six question types for this section:
- Identifying the functionality of a given C program or pseudo-code
- Finding syntactic or semantic bugs in code
- Conceptual programming questions (storage classes, scope, linkage)
- Elementary algorithm-based questions (searching, sorting steps)
- Data structure questions (stack, queue, linked list operations)
- C language fundamentals (pointer basics, library functions, memory)
The syllabus spans four areas: C language (call by value/reference, storage classes, pointers, library functions), data structures (array, stack, queue, linked list, trees, hash tables), algorithms (basic search and sort, tree traversal), and programming concepts (iteration, recursion, procedural vs. OOP).
Twenty minutes for 10 questions is tighter than it looks if a code-trace question contains a multi-step loop. Practice reading code fast, not just solving isolated problems.
C Language Fundamentals: MCQs 1–7
These seven questions cover the C topics TCS tests most consistently.
-
Q1. In C, if a function’s return type is not declared explicitly, what type does it default to?
- a)
void - b)
int - c)
float - d)
char
- a)
-
Answer: b)
int. The C89/C90 standard applies “implicit int” when no return type is declared. C99 removed this rule, but TCS test banks preserve these classic questions. -
Q2. Which of the following is NOT a valid C data type?
- a)
signed int - b)
big int - c)
short int - d)
long int
- a)
-
Answer: b)
big int. Standard C providesint,short int,long int,long long int, and their signed/unsigned variants.big intis not part of any C standard. -
Q3. Which of the following is NOT a valid storage class in C?
- a)
extern - b)
dynamic - c)
register - d)
auto
- a)
-
Answer: b)
dynamic. C has exactly four storage classes:auto,register,static, andextern. “Dynamic” describes heap-allocation behavior but is not a storage class specifier. -
Q4. What is
#defineused for in C?- a) Declaring a variable
- b) Defining a macro
- c) Declaring a function
- d) Defining a constant variable
-
Answer: b) Defining a macro.
#defineis a preprocessor directive that creates a text-substitution macro. It runs before compilation, so it is not a variable or function declaration. -
Q5. What does
realloc()do?- a) Retrieves previously freed memory
- b) Reallocates a file pointer
- c) Resizes a statically declared array
- d) Changes the size of a dynamically allocated memory block
-
Answer: d).
realloc(ptr, new_size)resizes a heap-allocated block. It may move the block to a new address and copy the existing content if relocation is needed. -
Q6. What does the declaration
int *p;mean?- a)
pis an integer variable - b)
pis a pointer to an integer - c)
pstores the address of a pointer - d)
pis a constant integer
- a)
-
Answer: b)
pis a pointer to an integer. The*in a declaration is the pointer declarator.int *pmeans p holds the memory address of an int-sized location. -
Q7. Which is the correct C syntax for command-line arguments?
- a)
int main(char *argv[], int argc) - b)
int main() { int argv; char *argc[]; } - c)
int main(int var, char *varg[]) - d)
int main(void)
- a)
-
Answer: c)
int main(int var, char *varg[]). The C standard requires the first parameter to beint(the argument count) and the second to be a pointer-to-char array (the argument vector). Parameter names are arbitrary. Option (a) reverses the types. Option (d) is valid C but receives no command-line arguments.
Data Structures: MCQs 8–11
Data structure questions test the abstract properties of each structure.
-
Q8. A queue data structure follows which ordering principle?
- 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). Elements leave the queue in the same order they entered.
-
Q9. Which of the following are the standard operations on a stack?
- a) Push and pop
- b) Push, pop, and remove
- c) Push, pop, add, and remove
- d) Push, pop, add, remove, and substitute
-
Answer: a) Push and pop. A standard stack exposes exactly two mutation operations: push (insert at top) and pop (remove from top). Arbitrary removal or substitution at other positions breaks LIFO discipline.
-
Q10. An image viewer lets users navigate forward and backward through photos. Which data structure suits this best?
- a) Tree
- b) Queue
- c) Doubly linked list
- d) Stack
-
Answer: c) Doubly linked list. Each node carries both a
nextand aprevpointer, enabling traversal in both directions. A queue only supports one-way traversal; a stack only exposes the top element. -
Q11. A text editor’s undo feature records each action; pressing Ctrl+Z reverses the most recent action first. Which data structure fits?
- a) Stack
- b) Queue
- c) Linked list
- d) Array
-
Answer: a) Stack. Undo is the canonical stack use case. The most recent action sits at the top; each Ctrl+Z pops and reverses it. A queue would reverse the oldest action first, the opposite of expected undo behavior.
Algorithms and Sorting: MCQ 12
This question circulates widely online with an incorrect answer. The trace below is derived from scratch.
- Q12. Given array
[64, 34, 25, 12, 22, 11, 9], what is the state after ONE complete 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]
- a)
- Answer: a)
[34, 25, 12, 22, 11, 9, 64]. Step-by-step trace:- Step 1: compare 64, 34 — swap —
[34, 64, 25, 12, 22, 11, 9] - Step 2: compare 64, 25 — swap —
[34, 25, 64, 12, 22, 11, 9] - Step 3: compare 64, 12 — swap —
[34, 25, 12, 64, 22, 11, 9] - Step 4: compare 64, 22 — swap —
[34, 25, 12, 22, 64, 11, 9] - Step 5: compare 64, 11 — swap —
[34, 25, 12, 22, 11, 64, 9] - Step 6: compare 64, 9 — swap —
[34, 25, 12, 22, 11, 9, 64]
- Step 1: compare 64, 34 — swap —
One pass moves the largest element (64) to its final position at the end. The commonly cited option (b) [25, 12, 22, 11, 9, 34, 64] is the state after a second pass, not the first.
Programming MCQs and Your NQT Track
TCS uses the overall NQT percentile to route candidates into three hiring tracks. Programming MCQs contribute to that composite score.
| Track | CTC band | Context |
|---|---|---|
| TCS Ninja | Rs.3.5–3.9 LPA | Baseline NQT; moderate programming accuracy sufficient |
| TCS Digital | Rs.7.0–7.5 LPA | Higher NQT cutoff; programming accuracy matters more |
| TCS Prime | Rs.9.0–11.0 LPA | Top NQT performance; strong technical section expected |
The gap between tracks is substantial, and the competition for the upper tiers has intensified. According to TCS CHRO Sudeep Kunnumal at the AI Impact Summit in March 2026, 60% of TCS’s fresher hires in FY26 are AI-skilled, up from 10 to 15% three years ago. The Prime track is now effectively the AI-skilled entry tier. Programming fundamentals remain the baseline; AI project experience separates Digital and Prime candidates.
TCS also cut its FY27 fresher intake to around 25,000, from 44,000 onboarded in FY26, with the tilt toward AI-skilled candidates increasing further. Fewer seats, tighter NQT competition. The programming section is not a place to give away easy marks.
For the full TCS NQT aptitude section pattern and worked questions, the format differs but the same composite-percentile logic applies. The TCS Ninja pattern and question types covers what comes after the NQT, once you’ve cleared the programming and TCS aptitude questions stages.
The 12 MCQs above cover the concepts TCS tests most consistently in this section. Once those fundamentals are solid, the next gap for most engineering students is building something deployed that demonstrates programming knowledge in an applied setting. TinkerLLM starts at Rs.299 and provides a hands-on environment to build and ship LLM-powered tools, the kind of project that strengthens a Digital or Prime track application alongside a competitive NQT score.
Primary sources
Frequently asked questions
How many programming MCQs are in the TCS NQT?
The TCS NQT programming section has 10 MCQs with a 20-minute time limit, roughly 2 minutes per question.
Is there negative marking in the TCS NQT programming section?
TCS NQT does not apply negative marking for the MCQ sections. Unattempted questions score zero; incorrect answers do not deduct marks.
What programming language do TCS NQT MCQs focus on?
The majority of TCS NQT programming MCQs are C-language based, with occasional C++ or Java conceptual questions. The official syllabus lists C as the primary language.
Which data structure topics appear in TCS NQT programming MCQs?
TCS covers arrays, stacks, queues, linked lists, trees, and hash tables in the programming section. Stack and queue properties are the most frequently tested.
How does the TCS NQT programming score affect placement track selection?
TCS uses the overall NQT percentile, programming MCQs included, to route candidates into Ninja, Digital, or Prime tracks. A stronger programming score lifts the composite percentile and improves the chance of qualifying for a higher-CTC track.
A self-paced playground for building with LLMs.
TinkerLLM is FACE Prep's sister property. A guided environment for shipping real LLM applications, the kind of project that earns a paragraph on your resume, not a line.
Try TinkerLLM (₹299 launch)