What kind of coding questions may be asked in TCS NQT 2021

What kind of Coding Question may be Asked in TCS NQT?

You must be wondering What kind of Coding Question may be asked in TCS NQT? as the time limit is increased? Here you go with all your answer. TCS NQT has updated its hiring pattern and has added some new sections. In the new pattern NQT, the exam has a different section specially dedicated to the coding section.

There will be no negative marking in the test and the test is partially adaptive. This round will have 2 sections.

SectionNo. of questionsTimeDifficulty Level
Programming Logic1015 minsHigh
Hands-on Coding215 mins and 30 minsHigh
Coding questions asked in TCS NQT 2021

What kind of Coding Question may be Asked in TCS NQT 2021?

Programming MCQ:

This round will have 10 questions that need to be answered in 15 minutes. The questions in this round will be the MCQ type of questions. The questions will be asked from the fundamentals of coding, input-output questions, etc. 

The important topics in this section are: Functions, Arrays, Recursion, Linked List, Stacks, and Queues, etc.

This time TCS has allowed 4 languages and you can code in any language of your choice. You can switch languages for different questions. The languages allowed are:

  • C
  • C++
  • Java
  • Python

Hands-on Coding:

This section will have 2 questions. Question 1 needs to be answered in 15 minutes and question 2 in 30 minutes. In this round, you will be given statement questions and you need to write the code.
You can code in any language of your choice from
C, C++, Java, Python 

This is the most important section of the whole test. Even if you clear the first 4 rounds with 100% you still need to clear this round, otherwise, you won’t be able to qualify this round.
To clear this round, your code should run end to end and pass all the test cases.

Let’s take a sample question.
Ques- Write a program to find the Fibonacci series up to n terms.

Solution: In C

int main()
      //To initialize variables 
      int n1=0,n2=1,n3,limit,i;

      //To take user input
      printf("enter a limit of series \n");
      scanf( "%d",&limit);

      printf("Fibonacci series %d %d ",n1,n2);

      //To use this loop for given length
           //n1 and n2 sum  store in new variable n3
         //display serious 
          printf("%d ",n3);
     return 0;

Ques: Check whether the number is automorphic or not.

Solution: In Java.

import java.util.Scanner;
public class automorphic_number_or_not
	public static void main(String[] args)
		//scanner class declaration
		Scanner sc = new Scanner(System.in);
		//input from user
		System.out.print("Enter a number : ");				
		int number = sc.nextInt();
                //Convert the number to string
		String s1 = Integer.toString(number);
                //Calculate the length
		int l1 = s1.length();
		int sq = number * number;
		String s2 = Integer.toString(sq);
		int l2 = s2.length();
                //Create Substring
		String s3 = s2.substring(l2-l1);
			System.out.println("Automorphic Number");
			System.out.println("Not an Automorphic Number");
		//closing scanner class(not compulsory, but good practice)

To practice more such questions in all the levels and know the top 100 codes that may be asked in TCS NQT. Click the button below.

TCS expects graduates to know how to code as it gets many projects in which they need website development, etc and therefore they check the coding skills before hiring.
They take the coding test to see how much you are familiar with the coding languages. You need to know the basics of coding to crack the exam and then they will train you in the training period.