Tcs — Coding Questions 2021 _verified_

for(int i = 0; i < n; i++) if(arr[i] % 2 == 0) evenCount++; oddCount = 0; else oddCount++; evenCount = 0;

: Input oxygen levels for 3 trainees over 3 rounds. Calculate their average and identify the trainee with the highest average, provided it's above a minimum threshold. Preparation Resources

: If the platform asks you to print a number, do not include decorative strings like print("The answer is:", ans) . Print the exact output required (e.g., print(ans) ). Tcs Coding Questions 2021

In the TCS NQT (Ninja and Digital roles), the coding section has specific constraints you must know before writing a single line of code.

An automobile manufacturer produces both two-wheelers (TW) and four-wheelers (FW). The manufacturing lead wants to verify the daily production logs automatically. Given the total number of vehicles ( ) and the total number of wheels ( for(int i = 0; i &lt; n; i++)

Typically 45 to 60 minutes for the coding section. Languages Allowed: C, C++, Java, Python 3.x, and Perl.

#include <stdio.h> #include <string.h>

Based on student memory banks, forums, and coaching centers like PrepInsta and Crony, here are the exact patterns that appeared repeatedly.

Example: Input - [1, 2, 3, 4, 5], target sum - 7, Output - 2 Print the exact output required (e

2y=W−2V⟹y=W−2V22 y equals cap W minus 2 cap V ⟹ y equals the fraction with numerator cap W minus 2 cap V and denominator 2 end-fraction x=V−yx equals cap V minus y Solution in Python 3