If you’re preparing for TCS NQT (National Qualifier Test), this blog will be your complete coding roadmap.
This post contains 100 most frequently asked TCS NQT coding questions, categorized topic-wise. I will be adding detailed solutions for each problem in this blog (or linking them individually).
๐ก Tip: It is believed that TCS gives additional weightage to candidates who solve more coding questions during campus hiring. While there is no official confirmation, strong coding performance definitely improves your chances.
๐ About TCS NQT
TCS NQT (National Qualifier Test) is conducted by Tata Consultancy Services (TCS) to hire candidates for roles like:
- TCS Ninja
- TCS Digital
Every year, more than 10 lakh+ candidates appear for this exam.
The Coding section plays a crucial role in final selection.
๐ TCS NQT Coding Questions (Topic Wise)
๐ข 1. Problems on Arrays
Below are the most important array-based coding questions asked in TCS NQT:
- Find the smallest number in an array
- Find the largest number in an array
- Second smallest and second largest element in an array
- Reverse a given array
- Count frequency of each element in an array
- Rearrange array in increasing-decreasing order
- Calculate sum of the elements of the array
- Rotate array by K elements (Block Swap Algorithm)
- Average of all elements in an array
- Find the median of the given array
- Remove duplicates from a sorted array
- Remove duplicates from an unsorted array
- Add element in an array
- Find all repeating elements in an array
- Find all non-repeating elements in an array
- Find all symmetric pairs in an array
- Maximum product subarray in an array
- Replace each element by its rank
- Sort elements by frequency
- Left and Right rotation of array
- Find equilibrium index of an array
- Circular rotation of array by K positions
- Sort array according to order defined by another array
- Search an element in an array
- Check if array is subset of another array
๐ (Add your solutions below each question or link them individually)
๐ข 2. Problems on Numbers
These number-based questions are extremely common in TCS coding tests:
- Check if a number is palindrome
- Find all palindrome numbers in a range
- Check if a number is prime
- Prime numbers in a given range
- Check if a number is Armstrong
- Check if a number is Perfect number
- Even or Odd
- Positive or Negative number
- Sum of first N natural numbers
- Sum of AP Series
- Sum of GP Series
- Greatest of two numbers
- Greatest of three numbers
- Leap Year or not
- Reverse digits of a number
- Maximum and minimum digit in a number
- Fibonacci series up to N terms
- Factorial of a number
- Power of a number
- Factors of a given number
- Print all prime factors
- Check if number is Strong number
- Check if number is Automorphic
- GCD of two numbers
- LCM of two numbers
- Harshad number
- Abundant number
- Sum of digits
- Sum of numbers in a range
- Permutations (N people occupying R seats)
- Add two fractions
- Replace all 0s with 1s in an integer
- Express number as sum of two primes
- Area of circle
- Roots of quadratic equation
๐ (Add detailed explanations and code solutions below each question)
๐ข 3. Problems on Number System
Important conversion-based questions:
- Binary to Decimal
- Binary to Octal
- Decimal to Binary
- Decimal to Octal
- Octal to Binary
- Octal to Decimal
- Convert digits/numbers to words
๐ 4. Problems on Sorting
Sorting algorithms are fundamental and frequently asked:
- Bubble Sort
- Selection Sort
- Insertion Sort
- Quick Sort
- Merge Sort
๐ Include:
- Algorithm explanation
- Time complexity
- Code implementation
๐ค 5. Problems on Strings
String problems are very common in TCS NQT:
- Check if string is palindrome
- Count vowels, consonants, spaces
- ASCII value of a character
- Remove vowels from string
- Remove spaces from string
- Remove characters except alphabets
- Reverse a string
- Remove brackets from algebraic expression
- Sum of numbers in a string
- Capitalize first and last character of each word
- Frequency of characters
- Find non-repeating characters
- Check if two strings are anagrams
- Count common subsequences
- Wildcard string matching
- Maximum occurring character
- Remove duplicates from string
- Print duplicate characters
- Remove characters of second string from first
- Replace each letter with next lexicographic alphabet
- Largest word in string
- Sort characters in string
- Count number of words
- Word with highest repeated letters
- Change case of characters
- Concatenate strings
- Find substring and display position
- Reverse words in string
๐ Add:
- Approach explanation
- Optimized solution
- Time & space complexity
๐ฏ How to Use This Coding Sheet Effectively
โ Solve questions topic-wise
โ Practice without looking at solutions first
โ Time yourself
โ Revise important logic patterns
โ Focus on edge cases
๐ก Final Tips to Crack TCS NQT Coding Section
- Practice basic data structures thoroughly
- Master arrays and strings
- Be strong in number theory basics
- Understand sorting and recursion
- Improve speed and accuracy
- Practice previous year questions
๐ข Coming Soon
I will be adding:
- โ Detailed solutions for each question
- โ Optimized code in C++ / Java / Python
- โ Time & Space Complexity analysis
- โ Practice test sets
Stay tuned and bookmark this page! ๐
Leave a comment