Skip to content

Tcs Coding Questions 2021 [upd] Today

Remove all characters except alphabets from a given string. 3. Solved Examples from TCS NQT 2021 Example 1: TCS NQT 2021 Candy JAR Problem

High-level "Digital" roles often feature string manipulation or number theory. Problem Statement:

If all trainees are unfit (average < 70), display "All trainees are unfit".

Primality testing, series generation (Fibonacci, Leap Year cycles), base conversions, and LCM/GCD problems. Tcs Coding Questions 2021

def evaluate_trainees(): trainees = [0, 0, 0] # Reading 9 inputs row by row (Round 1: T1, T2, T3... etc) try: for i in range(3): # 3 rounds for j in range(3): # 3 trainees level = int(input()) if level < 1 or level > 100: print("INVALID INPUT") return trainees[j] += level except ValueError: print("INVALID INPUT") return # Calculate Averages averages = [round(t / 3) for t in trainees] max_avg = max(averages) if max_avg < 70: print("All trainees are unfit.") return for i in range(3): if averages[i] == max_avg: print(f"Trainee Number : i + 1") evaluate_trainees() Use code with caution. 4. Pro-Tips to Crack the TCS Coding Section

Keywords integrated: TCS Coding Questions 2021, TCS NQT, TCS Ninja coding, TCS Digital preparation, prime number problems, string manipulation TCS, coin change TCS.

The TCS National Qualifier Test (NQT) in 2021 was a pivotal hiring year, offering thousands of engineering students positions in Ninja and Digital roles. Understanding the is crucial for candidates preparing for upcoming TCS NQT examinations because the platform frequently repeats themes, topics, and structures from previous years. Remove all characters except alphabets from a given string

is valid (i.e., candy is available and ordering it doesn't break rules illegally), output the number of candies sold and the remaining candies. If the input is invalid, print "INVALID INPUT". (Standard default values used in 2021 test cases). Check if the ordered candies is greater than 0 and less than or equal to If valid, candies sold = . Remaining candies = If remaining candies ≤Kis less than or equal to cap K , the jar is automatically refilled back to Python Code:

If you are using 2021 questions as a benchmark, follow this roadmap to ensure you are ready for the current year's difficulty:

This classic condition-based question appeared in multiple 2021 slots. It tests your ability to handle basic input-output and constraints. Problem Statement: A jar has a capacity At any point, it has If a customer orders candies, you must update the jar. Refill Rule: Problem Statement: If all trainees are unfit (average

: Choose one language (C, C++, Java, or Python) and become proficient in its syntax and standard library functions. TCS allows language switching between questions, but consistency helps.

denoms = [50, 25, 10, 5, 3, 1] def min_coins(M, idx=0): if M == 0: return 0 for i in range(idx, len(denoms)): coin = denoms[i] if coin <= M: if coin == 10 and (M - coin) % 3 == 0: continue # skip 10 if remainder divisible by 3 res = min_coins(M - coin, i) if res != -1: return 1 + res return -1