Tcs Coding Questions 2021 ((top)) -

The 2021 TCS National Qualifier Test (NQT) coding paper typically featured two questions, ranging from easy array manipulation to intermediate dynamic programming, within a 45-60 minute timeframe. Common topics included string character counting, series generation (mixed powers of 2 and 3), and coordinate geometry, according to PrepInsta and TakeUForward. You can explore the full, detailed archives of these 2021 solved papers on PrepInsta.

for num in arr: complement = target_sum - num if complement in seen: count += 1 seen.add(num) // For smallest if(arr[i] < first_small) second_small = first_small; first_small = arr[i]; else if(arr[i] < second_small && arr[i] != first_small) second_small = arr[i];
    for (char ch : num.toCharArray()) 
        freq[ch - '0']++;
  1. Number Series: Finding the next term or printing a specific series pattern.
  2. Number Systems: Armstrong numbers, Palindromes, Prime factors.
  3. String Manipulation: Removing vowels, reversing strings, toggling cases.
  4. General Logic: Discount calculations, Fare calculations, BMI logic.
def is_palindrome(s):
    return s == s[::-1]

Memory Management: Functions like malloc(), calloc(), and free(). Tcs Coding Questions 2021