# TCS Coding Questions: Details for TCS Aspirants (2020 Update)

### Index

1. TCS Coding Questions
2. TCS coding questions Details(Most asked questions)
3. TCS coding questions Instructions
4. Things to remember for TCS coding questions/TCS Programming Test
5. TCS Programming Test 2019 & 2020 Online MCQ Quiz(PDF)
6. TCS Coding Test 2019 & 2020 Online MCQ Quiz
7. Most Asked TCS coding questions(Chapters List)
9. TCS coding questions 2019 Solutions
10. TCS coding rounds solutions
11. Placement Papers for TCS Programming Test/TCS coding Test
12. Most asked Command Line arguments questions.
13. TCS coding round Overview(The year 2018)
14. Frequently asked TCS Coding Questions.

## TCS Coding Questions

All the TCS (1) aspirants might be searching for TCS Coding Questions 2020 continuously. But all this research will not tell you everything about the TCS Coding Questions.

If you wish to crack the TCS Exam, you must have

• a proper preparation schedule
• time management skills
• It would be best if you gave equal time to each subject
• You must prepare from the previous year question papers
• Practice all the concepts thoroughly

## TCS coding questions Details (Most Asked Questions)

• String reversal(Question Type)- asked 14 times
• Average of two numbers(Question Type)- asked 39 times
• LCM of two numbers(Question Type)- asked 51 times
• HCF of numbers(Question Type)- asked 66 times
• Both LCM and HCF of numbers(Question Type)- asked 10 times
• Swapping and reversal of numbers(Question Type)- asked 20 times
• Series and factorial(Question Type)- asked 20 times
• Operations on Numbers(Question Type)- asked 30 times
• Miscellaneous questions(Question Type)- asked 20 times

## TCS coding questions Instructions

TCS Exam is a big exam. Thus, while preparing for it, you must cover each and every concept and must have a thorough knowledge of the subjects. Also, just knowing the syllabus won’t help you much. You should also know the exam pattern, types of questions asked, either the questions are theoretical or practical.

Below are some instructions related to TCS Coding questions.

1. You must attempt only One question for 20 minutes.
2. You are given a choice of C, C++, Java, Perl, Python 2.7.
3. You are given an IDE to debug.
4. Another important thing is for Java; the class name should be Maze.
5. You must input to the code either via STDIN or Command-line arguments.
6. Your program must write the output to STDOUT.
7. There are public & private tests based on the evaluation.

## Things to remember for TCS coding questions/TCS Programming Test

You must not vaguely prepare for the exam. Get the knowledge of each little detail about it and then start your preparation.

Below are the things that you must keep in mind while preparing TCS Coding Questions.

1. While writing the output, there should be no leading or trailing spaces in the output.
2. Except for the required output, there must not be any other text on the output screen.
3. If your output is a digit or number, then, no leading sign should be printed unless it is a negative number.
4. You should not print any scientific notation (3.9265E + 2).
5. All floating-point numbers in your output must include the decimal places, which are mentioned in the question.

## TCS Programming Test 2019 & 2020 Online MCQ Quiz (PDF)

The exam pattern for the TCS exam is revised regularly. In the recent revision, two more sections are added in the written paper.

These two sections are

• Technical MCQ based on C language & Coding (TCS Programming test)
• Quantitative ability

In these sections, there are 20 questions that you must answer in 40 minutes.

1. In Technical MCQs, aspirants can get some 2** questions that carry more marks.
2. There is negative marking in each section. Thus, it would help if you answered the questions with proper care.

Hence, you must practice C questions before the exam.

Also, there are some other things that you must know before the exam,

• How many vacancies are there?
• What is the syllabus?
• What is the pattern of the exam?
• You must practice aptitude, reasoning, and English questions to crack the paper.

## TCS Coding Test 2019 & 2020 Online MCQ Quiz

There is one other section in the TCS exam where the candidates are required to solve a programming question in 20 minutes. This question has to be solved with C programming with the help of an inbuilt compiler.

Most of the time, the question is a fundamental C language question of command-line arguments.

Thus to crack the exam, you must practice basic C language questions or problems like HCF, LCM, Reverse string, swapping, Fibonacci series, string programs, the sum of numbers, even/odd, leap year programs, and many more.

One thing you should always keep in mind is to have a thorough knowledge and practice of C programs.

## Most Asked TCS coding questions (Chapters List)

Some of the essential chapters that you must not leave while preparing for TCS Coding questions are:

• Reverse a String.
• Reverse a Number.
• Palindrome.
• Prime Number.
• Leap Year.
• Highest among ten numbers.
• Fibonacci Series.
• HCF / GCD.
• Factorial.
• Decimal to Binary & vice versa
• Armstrong Number.
• Area.
• Swap 2 numbers.
• Concatenate two strings.
• LCM of Two Number using CLP.
• Average of Two Numbers.
• Sum of Digits of a number.
• Binary to Decimal.
• Decimal to Binary.
• Factorial of a Number.
• Square Root of Prime Number.
• Square Root without a square root.
• Armstrong Number.
• Odd-Even Number.
• Binary to Octal.
• Decimal to Octal.
• Check Leap Year.
• Area of Circle.
• Checking Palindrome (Number).
• Area of Triangle.
• Checking Palindrome (String).
• Reverse Digits of a Number.
• Checking Prime or Not.

Prepare and practice these topics with utmost concentration and determination. There are very high chances of these questions coming in the exam. We hope these TCS Coding questions are useful for you and help you is cracking the exam.

You must be prepared for these questions before your interview. Also, towards the end of the article, you will find a list of the most asked questions. SO, do read and practice them.

In TCS NQT Exam, you will be given 55 minutes to answer the TCS Coding Questions. On the other hand, in the TCS Ninja NQT, you will be given 30 minutes to answer all the questions. You can take the TCS Coding questions in any of the five programming languages.

• C
• C++
• Java
• Python
• Perl

Below are a few crucial things to keep in mind while answering the TCS Coding Questions:

### 1) Which programming language should a candidate choose to respond to?

The language problem is a fundamental problem that every candidate faces. Every TCS NQT 2020 participant has in his/her mind. Should you use C or C++? Will Java, Perl, or Python give you extra marks?

The answer to this problem is pretty simple.

You will not get any extra marks or bonus marks based on the programming language you choose to answer in. Moreover, if you make any mistakes by deciding a language that you are not familiar with, the damage will be more substantial.

So, we genuinely advise you to adhere to the language which you are satisfied with. As long as the output is accurate, the programming language you chose will not be noticed.

### 2) How much coding knowledge does a candidate requires?

You will be content to know that we have a piece of good news for you in this case.

If you are appearing for the TCS Exam and are worried about TCS Coding questions, do not worry because candidates do not require in-depth coding expertise to pass the TCS Coding Questions. The Coding questions will be more likely based on straight and straightforward concepts and will probably be straightforward. You need not bother about algorithms, command-line applications, and data structures. You don’t have to stress about linked lists, stacks, queues, trees, and other tough concepts. That must be a big comfort to you, right?

#### You are more likely to get questions based on:

• Questions based on Basic loops such as:
• For loop questions
• While loop questions
• Questions based on Conditional Statements such as:
• Switch statements questions
• If-else statement questions

In most cases, you are needed to write or solve the programs based on conditional statements and normal loops conditions consisting of arrays, strings, and much more.

In sum, you have only limited syllabus or topics to prepare for the TCS Coding Questions to excel at the TCS NQT 2020. So, study hard, channelize your energy, and plan your strategy well.

### Here are some steps to follow while solving the TCS Coding questions with ease:

• Understand the question:

Spend the first 5 minutes to understand the question given to you and comprehend the answer. If your English is not too good, give more time to read your TCS coding question.

• Read the given Input carefully:

You might not know how to find the answer, but you know how to take the Input. So, you must read the input values carefully.

• Crack the Logic:

You must comprehend how to convert the given data into the answer. By this time, you will have about 20 minutes left. So, use this time sensibly to manifest your coding expertise.

## TCS coding questions 2019 Solutions

Also, you must practice the following TCS Coding questions for getting selected.

1. TCS Command Line Arguments – Fibonacci Series
2. TCS Command Line Program to Swap two numbers
3. TCS String Reversal Using Command Line Programming
4. Greatest of Two Numbers using CLP
5. LCM of Two Number using CLP
6. Average of Two Numbers
7. Sum of Digits of a number
8. Area of a Triangle

## TCS coding rounds solutions

These are some of the solutions for the TCS Coding rounds/TCS coding questions/ TCS programming questions.

• TCS Coding Questions – 1
• TCS Coding Questions – 2
• TCS Programming Questions – 4
• TCS Programming Questions – 5
• TCS Programming Questions – 6
• TCS Command Line Program – 7

Do have a thorough knowledge of these concepts and questions. They will, without a doubt, help you in clearing the exam and getting the job in the MNC.

## Placement Papers for TCS Programming Test/TCS coding Test

Some of the popular placement papers for the TCS Exam are given below. They contain the topics which are frequently asked in the exam. Thus, they will help you know the exam syllabus, exam pattern, most asked questions, and ultimately, you will be able to ace the exam.

• Checking Palindrome (Number)
• Checking Palindrome (String)
• Checking Prime or Not
• Reverse Digits of a Number
• TCS Coding Questions – 3
• Prime Sum in a Given Range
• TCS Array Ascending Descending

You should definitely try these questions. They will help you analyze your preparation and improve your skills. You will know which concepts you lack in. Hence, you will get a chance to perfect your training.

## Most asked Command Line arguments questions.

Most of the time, in the TCS exam, candidates are asked a fundamental C language question related to command line arguments. Thus, you must know them before your paper/interview.

Below is the list of most frequently asked command-line argument question.

• Binary to Decimal
• Decimal to Binary
• Factorial of a Number
• Square Root of Prime Number
• Square Root without sqrt.h
• Armstrong Number
• Odd-Even Number
• Binary to Octal
• Decimal to Octal
• Check Leap Year
• Area of Circle
• Area of Triangle

Give these questions a try and know where you stand in your preparation.

## TCS coding round Overview (The year 2018)

Below is the analysis of TCS Coding questions of the year 2018.

1) TCS Coding Round Questions about HCF and LCM (Question Type)

• Chances of this type are 10.
• The time duration is 18 to 20 minutes.
• The difficulty level is medium.

2) TCS Coding Test about Factorial and Series(Question Type)

• Chances of this type are 25.
• The time duration is 18 to 20 minutes.
• The difficulty level is high.

3) Swapping and Reversal TCS coding Questions(Question Type)

• Chances of this type are 20.
• The time duration is 18 to 20 minutes.
• The difficulty level is Medium-high.

4) Number Operations questions(Question type)

• Chances of this type are 20-25.
• The time duration is 18 to 20 minutes.
• The difficulty level is high.

5) Miscellaneous questions (Question Type)

• Chances of this type are 20-25.
• The time duration is 18 to 20 minutes.
• The difficulty level is Medium-high.

## Frequently asked TCS Coding Questions.

1. What is a linker program?
2. Factorial of a number
3. Area of a circle
4. Leap year or not
5. GCD of two number
6. Check whether a given number is a prime number or not
7. Print all prime numbers in a given range
8. Check whether a given number is a Strong number or not
9. Check whether a number is a Palindrome or not
10. Check whether a string is a Palindrome or not
11. Check whether a given number is an Armstrong number or not
12. Print all Armstrong numbers between two intervals
13. Fibonacci series generation up to N terms questions
14. Binary to decimal conversion questions
15. Decimal to binary conversion questions
16. Decimal to octal conversion questions
17. Octal to decimal conversion questions
18. Binary to octal conversion questions
19. Octal to binary conversion questions
20. Sum of all prime numbers within a range
21. Reversing a given number question
22. Reverse a string questions
23. Pyramid pattern using stars
24. Pyramid pattern using numbers
25. Diamond pattern printing using stars
26. Diamond pattern printing using numbers
27. The second smallest element in an array
28. Remove duplicate elements in an array.