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:

  1. Find the smallest number in an array
  2. Find the largest number in an array
  3. Second smallest and second largest element in an array
  4. Reverse a given array
  5. Count frequency of each element in an array
  6. Rearrange array in increasing-decreasing order
  7. Calculate sum of the elements of the array
  8. Rotate array by K elements (Block Swap Algorithm)
  9. Average of all elements in an array
  10. Find the median of the given array
  11. Remove duplicates from a sorted array
  12. Remove duplicates from an unsorted array
  13. Add element in an array
  14. Find all repeating elements in an array
  15. Find all non-repeating elements in an array
  16. Find all symmetric pairs in an array
  17. Maximum product subarray in an array
  18. Replace each element by its rank
  19. Sort elements by frequency
  20. Left and Right rotation of array
  21. Find equilibrium index of an array
  22. Circular rotation of array by K positions
  23. Sort array according to order defined by another array
  24. Search an element in an array
  25. 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:

  1. Check if a number is palindrome
  2. Find all palindrome numbers in a range
  3. Check if a number is prime
  4. Prime numbers in a given range
  5. Check if a number is Armstrong
  6. Check if a number is Perfect number
  7. Even or Odd
  8. Positive or Negative number
  9. Sum of first N natural numbers
  10. Sum of AP Series
  11. Sum of GP Series
  12. Greatest of two numbers
  13. Greatest of three numbers
  14. Leap Year or not
  15. Reverse digits of a number
  16. Maximum and minimum digit in a number
  17. Fibonacci series up to N terms
  18. Factorial of a number
  19. Power of a number
  20. Factors of a given number
  21. Print all prime factors
  22. Check if number is Strong number
  23. Check if number is Automorphic
  24. GCD of two numbers
  25. LCM of two numbers
  26. Harshad number
  27. Abundant number
  28. Sum of digits
  29. Sum of numbers in a range
  30. Permutations (N people occupying R seats)
  31. Add two fractions
  32. Replace all 0s with 1s in an integer
  33. Express number as sum of two primes
  34. Area of circle
  35. Roots of quadratic equation

๐Ÿ‘‰ (Add detailed explanations and code solutions below each question)


๐Ÿ”ข 3. Problems on Number System

Important conversion-based questions:

  1. Binary to Decimal
  2. Binary to Octal
  3. Decimal to Binary
  4. Decimal to Octal
  5. Octal to Binary
  6. Octal to Decimal
  7. Convert digits/numbers to words

๐Ÿ”„ 4. Problems on Sorting

Sorting algorithms are fundamental and frequently asked:

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Quick Sort
  5. Merge Sort

๐Ÿ‘‰ Include:

  • Algorithm explanation
  • Time complexity
  • Code implementation

๐Ÿ”ค 5. Problems on Strings

String problems are very common in TCS NQT:

  1. Check if string is palindrome
  2. Count vowels, consonants, spaces
  3. ASCII value of a character
  4. Remove vowels from string
  5. Remove spaces from string
  6. Remove characters except alphabets
  7. Reverse a string
  8. Remove brackets from algebraic expression
  9. Sum of numbers in a string
  10. Capitalize first and last character of each word
  11. Frequency of characters
  12. Find non-repeating characters
  13. Check if two strings are anagrams
  14. Count common subsequences
  15. Wildcard string matching
  16. Maximum occurring character
  17. Remove duplicates from string
  18. Print duplicate characters
  19. Remove characters of second string from first
  20. Replace each letter with next lexicographic alphabet
  21. Largest word in string
  22. Sort characters in string
  23. Count number of words
  24. Word with highest repeated letters
  25. Change case of characters
  26. Concatenate strings
  27. Find substring and display position
  28. 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! ๐Ÿš€

โ˜†ๅฝกึ†ฮฑั‚ัƒฮฑะผ๐Ÿ‡ฎ๐Ÿ‡ณ [โ˜†แ•แŽถ ] Avatar

Published by

Leave a comment

Design a site like this with WordPress.com
Get started