Tcs Coding Questions 2021 !new!
Output: 170 (Logic: 0 + 70 + 100 = 170)
Example: Input - [-2, 1, -3, 4, -1, 2, 1, -5, 4], Output - 6 Tcs Coding Questions 2021
TCS often tests base conversions. In 2021, a specific challenge involved converting a number from (using A=10, B=11... G=16) to decimal (Base 10). → Output: 4. Cyclically Rotate an Array The Problem: Given an array of integers and a value , rotate the array clockwise by positions. [10, 20, 30, 40, 50] → Output: [40, 50, 10, 20, 30] Use the formula (index + K) % N Output: 170 (Logic: 0 + 70 + 100
Analysis of TCS NQT Coding Questions (2021) The 2021 TCS National Qualifier Test (NQT) coding section was characterized by a shift toward assessing fundamental problem-solving efficiency and precision in handling standard input/output. The questions generally ranged from , focusing heavily on mathematical series, string manipulation, and array-based logic . 1. Exam Structure and Pattern → Output: 4
s1 = input().strip() s2 = input().strip() print(are_anagrams(s1, s2))
1 ≤ N ≤ 10⁵ -10⁴ ≤ arr[i] ≤ 10⁴
Many lost marks by using replace() in Python without controlling overlap.