Cracking the TCS National Qualifier Test (NQT) requires strong problem-solving skills, especially in the Coding Section under IT Programming. This section tests a candidate’s proficiency in logical reasoning, programming fundamentals, and coding efficiency.
This guide provides a detailed overview of the TCS NQT Coding Section Pattern, along with some of the most frequently asked TCS coding questions and their solutions.
The Coding section follows a structured format:
Convert a four-digit number in base 17 (where 10 = A, 11 = B, 12 = C, …, 16 = G) to its decimal equivalent.
Input: 23GF
Expected Output: Decimal equivalent of 23GF
A person starts from the origin (0,0) and moves in a specific pattern:
Find the final position after n
moves.
2 <= n <= 1000
Input: 3
Expected Output: Final coordinates after 3
moves.
Check if a given word is a reserved keyword in a programming language.
break, case, continue, default, defer, else, for, func, goto, if, map, range, return, struct, type, var
Input: defer
Output: defer is a keyword
A jar contains N
candies. If the number of candies left reaches K
, it is refilled.
Example:
Input: 3
Output:
Number of Candies Sold: 3
Number of Candies available: 7
Three trainees participate in a fitness test. Their oxygen levels are recorded after three rounds. Identify the fittest trainee based on average oxygen levels.
1 - 100
.Input:
95 92 95
92 90 92
90 92 90
Output:
Trainee Number: 1
Trainee Number: 3
Given a range m to n, print numbers with leading zeroes.
Input: 5 10
Expected Output: 05 06 07 08 09 10
Given a number (up to 100 digits), compute the difference between the sum of odd-positioned and even-positioned digits.
Input: 4567
Output: 2
A queue of children is given mints. Each child (except the first) has one mint less than the sum of all children before them.
2 < n < 10
1 < len < 20
Input: 4 2
Output: 7
Mastering these coding problems will significantly improve your chances of clearing the TCS NQT Coding Section. Focus on practicing similar data structures and algorithm problems to enhance your problem-solving skills.