Tcs Coding Questions 2021 File
Reverse the words in a given sentence while keeping the word order the same. Remove Vowels: Remove all vowels from a string.
def check_keyword(word): keywords = "break", "case", "continue", "default", "defer", "else", "for", "func", "goto", "if", "map", "range", "return", "struct", "switch", "type", "var" if word in keywords: return f"word is a keyword" else: return f"word is not a keyword" # Driver Code if __name__ == "__main__": user_input = input().strip() print(check_keyword(user_input)) Use code with caution. 2. The Oxygen Level Problem (Selection Logic) Problem Statement Tcs Coding Questions 2021
public class Main public static void main(String[] args) Scanner sc = new Scanner(System.in); int dist = sc.nextInt(); int fare = 0; Reverse the words in a given sentence while
import java.util.Scanner; public class Main public static void main(String[] args) Scanner sc = new Scanner(System.粉in); int[][] rounds = new int[3][3]; int[] average = new int[3]; for (int i = 0; i < 9; i++) if (sc.hasNextInt()) int input = sc.nextInt(); if (input < 1 int maxAverage = 0; for (int i = 0; i < 3; i++) average[i] = rounds[i][0] / 3; if (average[i] > maxAverage) maxAverage = average[i]; if (maxAverage < 70) System.out.println("All trainees are unfit."); return; for (int i = 0; i < 3; i++) if (average[i] == maxAverage) System.out.println("Trainee Number : " + (i + 1)); Use code with caution. 4. Key Execution Pitfalls on TCS iON High-Frequency Questions & Solutions Dynamic Programming
The 2021 question bank heavily favored arithmetic logic, array traversals, and string manipulation techniques. Topic Category Core Concepts Tested Base conversions, series generation, prime numbers Array Manipulation Subarrays, matrix rotations, sliding window String Processing Palindromes, anagrams, custom tokenization Data Structures Hashing, stacks, custom structures 3. High-Frequency Questions & Solutions
Dynamic Programming, Graph Theory, Advanced Tree structures, Matrix Manipulation, and greedy algorithms.
The emphasized a strong grasp of fundamentals over complex algorithms. By focusing on array manipulations, string operations, and basic number theory, candidates could successfully clear the coding round. Consistent practice of previous year papers is key to tackling the variations in these questions.